├── src └── enums │ ├── authenticator-type.ts │ ├── theme.ts │ ├── adapter.ts │ ├── database-type.ts │ ├── health-check-status.ts │ ├── message-priority.ts │ ├── compression.ts │ ├── smtp-encryption.ts │ ├── deployment-download-type.ts │ ├── vcs-reference-type.ts │ ├── execution-trigger.ts │ ├── messaging-provider-type.ts │ ├── relation-mutate.ts │ ├── template-reference-type.ts │ ├── index-type.ts │ ├── health-antivirus-status.ts │ ├── authentication-factor.ts │ ├── relationship-type.ts │ ├── message-status.ts │ ├── output.ts │ ├── index-status.ts │ ├── column-status.ts │ ├── deployment-status.ts │ ├── image-format.ts │ ├── attribute-status.ts │ ├── execution-status.ts │ ├── execution-method.ts │ ├── image-gravity.ts │ ├── password-hash.ts │ ├── browser.ts │ ├── framework.ts │ ├── name.ts │ └── credit-card.ts ├── .github └── workflows │ └── autoclose.yml ├── docs └── examples │ ├── account │ ├── create-jwt.md │ ├── create-anonymous-session.md │ ├── get.md │ ├── get-prefs.md │ ├── create-mfa-challenge.md │ ├── create-session.md │ ├── list-sessions.md │ ├── update-status.md │ ├── delete-sessions.md │ ├── list-mfa-factors.md │ ├── create-phone-token.md │ ├── update-phone-session.md │ ├── get-mfa-recovery-codes.md │ ├── create-mfa-recovery-codes.md │ ├── create-phone-verification.md │ ├── update-magic-url-session.md │ ├── update-mfa-recovery-codes.md │ ├── update-mfa.md │ ├── update-name.md │ ├── create-email-password-session.md │ ├── get-session.md │ ├── delete-session.md │ ├── update-session.md │ ├── create-email-token.md │ ├── delete-identity.md │ ├── create-verification.md │ ├── create.md │ ├── create-email-verification.md │ ├── list-logs.md │ ├── update-phone.md │ ├── create-mfa-authenticator.md │ ├── delete-mfa-authenticator.md │ ├── update-email.md │ ├── update-verification.md │ ├── list-identities.md │ ├── update-mfa-challenge.md │ ├── update-password.md │ ├── create-recovery.md │ ├── update-email-verification.md │ ├── update-phone-verification.md │ ├── update-recovery.md │ ├── update-mfa-authenticator.md │ ├── create-magic-url-token.md │ ├── update-prefs.md │ └── create-o-auth-2-token.md │ ├── health │ ├── get.md │ ├── get-db.md │ ├── get-time.md │ ├── get-cache.md │ ├── get-pub-sub.md │ ├── get-antivirus.md │ ├── get-storage.md │ ├── get-storage-local.md │ ├── get-certificate.md │ ├── get-queue-builds.md │ ├── get-queue-logs.md │ ├── get-queue-mails.md │ ├── get-queue-usage.md │ ├── get-queue-deletes.md │ ├── get-queue-webhooks.md │ ├── get-queue-functions.md │ ├── get-queue-messaging.md │ ├── get-queue-migrations.md │ ├── get-queue-certificates.md │ ├── get-queue-stats-resources.md │ ├── get-failed-jobs.md │ └── get-queue-databases.md │ ├── locale │ ├── get.md │ ├── list-codes.md │ ├── list-countries.md │ ├── list-languages.md │ ├── list-continents.md │ ├── list-countries-eu.md │ ├── list-currencies.md │ └── list-countries-phones.md │ ├── sites │ ├── list-frameworks.md │ ├── list-specifications.md │ ├── get.md │ ├── delete.md │ ├── list-variables.md │ ├── get-log.md │ ├── delete-log.md │ ├── get-variable.md │ ├── delete-variable.md │ ├── get-deployment.md │ ├── delete-deployment.md │ ├── list-logs.md │ ├── update-site-deployment.md │ ├── list.md │ ├── update-deployment-status.md │ ├── create-duplicate-deployment.md │ ├── create-variable.md │ ├── list-deployments.md │ ├── get-deployment-download.md │ ├── create-vcs-deployment.md │ └── update-variable.md │ ├── functions │ ├── list-runtimes.md │ ├── list-specifications.md │ ├── get.md │ ├── delete.md │ ├── list-variables.md │ ├── get-variable.md │ ├── delete-variable.md │ ├── delete-execution.md │ ├── get-deployment.md │ ├── get-execution.md │ ├── delete-deployment.md │ ├── list.md │ ├── update-deployment-status.md │ ├── update-function-deployment.md │ ├── list-executions.md │ ├── create-variable.md │ ├── create-duplicate-deployment.md │ ├── list-deployments.md │ ├── get-deployment-download.md │ ├── create-vcs-deployment.md │ ├── update-variable.md │ └── create-deployment.md │ ├── users │ ├── get.md │ ├── delete.md │ ├── get-prefs.md │ ├── create-session.md │ ├── delete-sessions.md │ ├── list-mfa-factors.md │ ├── delete-identity.md │ ├── get-mfa-recovery-codes.md │ ├── update-mfa.md │ ├── create-mfa-recovery-codes.md │ ├── update-labels.md │ ├── update-mfa-recovery-codes.md │ ├── update-name.md │ ├── update-prefs.md │ ├── update-password.md │ ├── update-status.md │ ├── get-target.md │ ├── update-phone.md │ ├── delete-target.md │ ├── list-sessions.md │ ├── update-email.md │ ├── delete-session.md │ ├── list-logs.md │ ├── update-email-verification.md │ ├── update-phone-verification.md │ ├── create-token.md │ ├── delete-mfa-authenticator.md │ ├── list-targets.md │ ├── list.md │ ├── create-jwt.md │ ├── list-identities.md │ ├── create-md-5-user.md │ ├── create-argon-2-user.md │ ├── create-bcrypt-user.md │ ├── create-ph-pass-user.md │ ├── list-memberships.md │ ├── create.md │ ├── create-sha-user.md │ ├── update-target.md │ └── create-target.md │ ├── graphql │ ├── query.md │ └── mutation.md │ ├── tokens │ ├── get.md │ ├── delete.md │ ├── update.md │ ├── create-file-token.md │ └── list.md │ ├── teams │ ├── get.md │ ├── delete.md │ ├── get-prefs.md │ ├── update-prefs.md │ ├── update-name.md │ ├── create.md │ ├── get-membership.md │ ├── delete-membership.md │ ├── list.md │ ├── update-membership.md │ ├── list-memberships.md │ └── update-membership-status.md │ ├── tablesdb │ ├── get.md │ ├── delete.md │ ├── create-transaction.md │ ├── list-transactions.md │ ├── get-transaction.md │ ├── delete-transaction.md │ ├── get-table.md │ ├── delete-table.md │ ├── get-index.md │ ├── get-column.md │ ├── create.md │ ├── delete-column.md │ ├── delete-index.md │ ├── update.md │ ├── list.md │ ├── update-transaction.md │ ├── list-columns.md │ ├── list-indexes.md │ ├── create-rows.md │ ├── list-tables.md │ ├── upsert-rows.md │ ├── delete-row.md │ ├── delete-rows.md │ ├── create-point-column.md │ ├── update-ip-column.md │ ├── create-line-column.md │ ├── get-row.md │ ├── create-ip-column.md │ ├── update-boolean-column.md │ ├── update-datetime-column.md │ ├── update-rows.md │ ├── create-polygon-column.md │ ├── list-rows.md │ ├── update-url-column.md │ ├── create-datetime-column.md │ ├── update-email-column.md │ ├── update-point-column.md │ ├── create-boolean-column.md │ ├── update-relationship-column.md │ ├── create-index.md │ ├── create-url-column.md │ ├── update-enum-column.md │ ├── create-email-column.md │ ├── update-line-column.md │ ├── create-enum-column.md │ ├── update-string-column.md │ ├── update-polygon-column.md │ ├── create-table.md │ ├── update-table.md │ ├── update-float-column.md │ ├── update-integer-column.md │ ├── create-float-column.md │ ├── create-string-column.md │ ├── update-row.md │ └── upsert-row.md │ ├── databases │ ├── get.md │ ├── delete.md │ ├── create-transaction.md │ ├── list-transactions.md │ ├── get-transaction.md │ ├── delete-transaction.md │ ├── get-collection.md │ ├── create.md │ ├── delete-collection.md │ ├── get-index.md │ ├── update.md │ ├── delete-index.md │ ├── list.md │ ├── get-attribute.md │ ├── delete-attribute.md │ ├── update-transaction.md │ ├── list-indexes.md │ ├── list-attributes.md │ ├── list-collections.md │ ├── create-documents.md │ ├── upsert-documents.md │ ├── delete-documents.md │ ├── create-point-attribute.md │ ├── delete-document.md │ ├── update-ip-attribute.md │ ├── create-line-attribute.md │ ├── create-ip-attribute.md │ ├── update-boolean-attribute.md │ ├── update-datetime-attribute.md │ ├── create-polygon-attribute.md │ ├── update-documents.md │ ├── update-url-attribute.md │ ├── create-datetime-attribute.md │ ├── get-document.md │ ├── list-documents.md │ ├── update-email-attribute.md │ ├── update-point-attribute.md │ ├── create-boolean-attribute.md │ ├── update-relationship-attribute.md │ ├── create-index.md │ ├── create-url-attribute.md │ ├── update-enum-attribute.md │ ├── create-email-attribute.md │ ├── update-line-attribute.md │ ├── create-enum-attribute.md │ ├── update-string-attribute.md │ └── update-polygon-attribute.md │ ├── storage │ ├── get-bucket.md │ ├── delete-bucket.md │ ├── get-file.md │ ├── delete-file.md │ ├── list-buckets.md │ ├── get-file-view.md │ ├── get-file-download.md │ ├── list-files.md │ ├── update-file.md │ └── create-file.md │ ├── messaging │ ├── delete.md │ ├── get-topic.md │ ├── delete-topic.md │ ├── get-message.md │ ├── get-provider.md │ ├── delete-provider.md │ ├── get-subscriber.md │ ├── delete-subscriber.md │ ├── create-topic.md │ ├── list-targets.md │ ├── list-topic-logs.md │ ├── list-topics.md │ ├── list-messages.md │ ├── update-topic.md │ ├── list-message-logs.md │ ├── list-provider-logs.md │ ├── list-providers.md │ ├── create-subscriber.md │ ├── list-subscriber-logs.md │ ├── list-subscribers.md │ ├── create-fcm-provider.md │ ├── update-fcm-provider.md │ ├── create-sms.md │ ├── update-sms.md │ ├── create-vonage-provider.md │ ├── create-msg-91-provider.md │ ├── create-telesign-provider.md │ ├── create-textmagic-provider.md │ ├── update-vonage-provider.md │ └── create-twilio-provider.md │ └── avatars │ ├── get-favicon.md │ ├── get-image.md │ ├── get-qr.md │ ├── get-flag.md │ ├── get-browser.md │ ├── get-initials.md │ └── get-credit-card.md └── tsconfig.json /src/enums/authenticator-type.ts: -------------------------------------------------------------------------------- 1 | export enum AuthenticatorType { 2 | Totp = 'totp', 3 | } -------------------------------------------------------------------------------- /src/enums/theme.ts: -------------------------------------------------------------------------------- 1 | export enum Theme { 2 | Light = 'light', 3 | Dark = 'dark', 4 | } -------------------------------------------------------------------------------- /src/enums/adapter.ts: -------------------------------------------------------------------------------- 1 | export enum Adapter { 2 | Static = 'static', 3 | Ssr = 'ssr', 4 | } -------------------------------------------------------------------------------- /src/enums/database-type.ts: -------------------------------------------------------------------------------- 1 | export enum DatabaseType { 2 | Legacy = 'legacy', 3 | Tablesdb = 'tablesdb', 4 | } -------------------------------------------------------------------------------- /src/enums/health-check-status.ts: -------------------------------------------------------------------------------- 1 | export enum HealthCheckStatus { 2 | Pass = 'pass', 3 | Fail = 'fail', 4 | } -------------------------------------------------------------------------------- /src/enums/message-priority.ts: -------------------------------------------------------------------------------- 1 | export enum MessagePriority { 2 | Normal = 'normal', 3 | High = 'high', 4 | } -------------------------------------------------------------------------------- /src/enums/compression.ts: -------------------------------------------------------------------------------- 1 | export enum Compression { 2 | None = 'none', 3 | Gzip = 'gzip', 4 | Zstd = 'zstd', 5 | } -------------------------------------------------------------------------------- /src/enums/smtp-encryption.ts: -------------------------------------------------------------------------------- 1 | export enum SmtpEncryption { 2 | None = 'none', 3 | Ssl = 'ssl', 4 | Tls = 'tls', 5 | } -------------------------------------------------------------------------------- /src/enums/deployment-download-type.ts: -------------------------------------------------------------------------------- 1 | export enum DeploymentDownloadType { 2 | Source = 'source', 3 | Output = 'output', 4 | } -------------------------------------------------------------------------------- /src/enums/vcs-reference-type.ts: -------------------------------------------------------------------------------- 1 | export enum VCSReferenceType { 2 | Branch = 'branch', 3 | Commit = 'commit', 4 | Tag = 'tag', 5 | } -------------------------------------------------------------------------------- /src/enums/execution-trigger.ts: -------------------------------------------------------------------------------- 1 | export enum ExecutionTrigger { 2 | Http = 'http', 3 | Schedule = 'schedule', 4 | Event = 'event', 5 | } -------------------------------------------------------------------------------- /src/enums/messaging-provider-type.ts: -------------------------------------------------------------------------------- 1 | export enum MessagingProviderType { 2 | Email = 'email', 3 | Sms = 'sms', 4 | Push = 'push', 5 | } -------------------------------------------------------------------------------- /src/enums/relation-mutate.ts: -------------------------------------------------------------------------------- 1 | export enum RelationMutate { 2 | Cascade = 'cascade', 3 | Restrict = 'restrict', 4 | SetNull = 'setNull', 5 | } -------------------------------------------------------------------------------- /src/enums/template-reference-type.ts: -------------------------------------------------------------------------------- 1 | export enum TemplateReferenceType { 2 | Branch = 'branch', 3 | Commit = 'commit', 4 | Tag = 'tag', 5 | } -------------------------------------------------------------------------------- /src/enums/index-type.ts: -------------------------------------------------------------------------------- 1 | export enum IndexType { 2 | Key = 'key', 3 | Fulltext = 'fulltext', 4 | Unique = 'unique', 5 | Spatial = 'spatial', 6 | } -------------------------------------------------------------------------------- /src/enums/health-antivirus-status.ts: -------------------------------------------------------------------------------- 1 | export enum HealthAntivirusStatus { 2 | Disabled = 'disabled', 3 | Offline = 'offline', 4 | Online = 'online', 5 | } -------------------------------------------------------------------------------- /src/enums/authentication-factor.ts: -------------------------------------------------------------------------------- 1 | export enum AuthenticationFactor { 2 | Email = 'email', 3 | Phone = 'phone', 4 | Totp = 'totp', 5 | Recoverycode = 'recoverycode', 6 | } -------------------------------------------------------------------------------- /src/enums/relationship-type.ts: -------------------------------------------------------------------------------- 1 | export enum RelationshipType { 2 | OneToOne = 'oneToOne', 3 | ManyToOne = 'manyToOne', 4 | ManyToMany = 'manyToMany', 5 | OneToMany = 'oneToMany', 6 | } -------------------------------------------------------------------------------- /src/enums/message-status.ts: -------------------------------------------------------------------------------- 1 | export enum MessageStatus { 2 | Draft = 'draft', 3 | Processing = 'processing', 4 | Scheduled = 'scheduled', 5 | Sent = 'sent', 6 | Failed = 'failed', 7 | } -------------------------------------------------------------------------------- /src/enums/output.ts: -------------------------------------------------------------------------------- 1 | export enum Output { 2 | Jpg = 'jpg', 3 | Jpeg = 'jpeg', 4 | Png = 'png', 5 | Webp = 'webp', 6 | Heic = 'heic', 7 | Avif = 'avif', 8 | Gif = 'gif', 9 | } -------------------------------------------------------------------------------- /src/enums/index-status.ts: -------------------------------------------------------------------------------- 1 | export enum IndexStatus { 2 | Available = 'available', 3 | Processing = 'processing', 4 | Deleting = 'deleting', 5 | Stuck = 'stuck', 6 | Failed = 'failed', 7 | } -------------------------------------------------------------------------------- /src/enums/column-status.ts: -------------------------------------------------------------------------------- 1 | export enum ColumnStatus { 2 | Available = 'available', 3 | Processing = 'processing', 4 | Deleting = 'deleting', 5 | Stuck = 'stuck', 6 | Failed = 'failed', 7 | } -------------------------------------------------------------------------------- /src/enums/deployment-status.ts: -------------------------------------------------------------------------------- 1 | export enum DeploymentStatus { 2 | Waiting = 'waiting', 3 | Processing = 'processing', 4 | Building = 'building', 5 | Ready = 'ready', 6 | Failed = 'failed', 7 | } -------------------------------------------------------------------------------- /src/enums/image-format.ts: -------------------------------------------------------------------------------- 1 | export enum ImageFormat { 2 | Jpg = 'jpg', 3 | Jpeg = 'jpeg', 4 | Png = 'png', 5 | Webp = 'webp', 6 | Heic = 'heic', 7 | Avif = 'avif', 8 | Gif = 'gif', 9 | } -------------------------------------------------------------------------------- /src/enums/attribute-status.ts: -------------------------------------------------------------------------------- 1 | export enum AttributeStatus { 2 | Available = 'available', 3 | Processing = 'processing', 4 | Deleting = 'deleting', 5 | Stuck = 'stuck', 6 | Failed = 'failed', 7 | } -------------------------------------------------------------------------------- /src/enums/execution-status.ts: -------------------------------------------------------------------------------- 1 | export enum ExecutionStatus { 2 | Waiting = 'waiting', 3 | Processing = 'processing', 4 | Completed = 'completed', 5 | Failed = 'failed', 6 | Scheduled = 'scheduled', 7 | } -------------------------------------------------------------------------------- /src/enums/execution-method.ts: -------------------------------------------------------------------------------- 1 | export enum ExecutionMethod { 2 | GET = 'GET', 3 | POST = 'POST', 4 | PUT = 'PUT', 5 | PATCH = 'PATCH', 6 | DELETE = 'DELETE', 7 | OPTIONS = 'OPTIONS', 8 | HEAD = 'HEAD', 9 | } -------------------------------------------------------------------------------- /src/enums/image-gravity.ts: -------------------------------------------------------------------------------- 1 | export enum ImageGravity { 2 | Center = 'center', 3 | Topleft = 'top-left', 4 | Top = 'top', 5 | Topright = 'top-right', 6 | Left = 'left', 7 | Right = 'right', 8 | Bottomleft = 'bottom-left', 9 | Bottom = 'bottom', 10 | Bottomright = 'bottom-right', 11 | } -------------------------------------------------------------------------------- /.github/workflows/autoclose.yml: -------------------------------------------------------------------------------- 1 | name: Auto-close External Pull Requests 2 | 3 | on: 4 | pull_request_target: 5 | types: [opened, reopened] 6 | 7 | jobs: 8 | auto_close: 9 | uses: appwrite/.github/.github/workflows/autoclose.yml@main 10 | secrets: 11 | GH_AUTO_CLOSE_PR_TOKEN: ${{ secrets.GH_AUTO_CLOSE_PR_TOKEN }} 12 | -------------------------------------------------------------------------------- /docs/examples/account/create-jwt.md: -------------------------------------------------------------------------------- 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(''); // Your project ID 6 | 7 | const account = new sdk.Account(client); 8 | 9 | const result = await account.createJWT(); 10 | -------------------------------------------------------------------------------- /src/enums/password-hash.ts: -------------------------------------------------------------------------------- 1 | export enum PasswordHash { 2 | Sha1 = 'sha1', 3 | Sha224 = 'sha224', 4 | Sha256 = 'sha256', 5 | Sha384 = 'sha384', 6 | Sha512224 = 'sha512/224', 7 | Sha512256 = 'sha512/256', 8 | Sha512 = 'sha512', 9 | Sha3224 = 'sha3-224', 10 | Sha3256 = 'sha3-256', 11 | Sha3384 = 'sha3-384', 12 | Sha3512 = 'sha3-512', 13 | } -------------------------------------------------------------------------------- /docs/examples/account/create-anonymous-session.md: -------------------------------------------------------------------------------- 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(''); // Your project ID 6 | 7 | const account = new sdk.Account(client); 8 | 9 | const result = await account.createAnonymousSession(); 10 | -------------------------------------------------------------------------------- /docs/examples/health/get.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.get(); 11 | -------------------------------------------------------------------------------- /docs/examples/health/get-db.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getDB(); 11 | -------------------------------------------------------------------------------- /docs/examples/health/get-time.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getTime(); 11 | -------------------------------------------------------------------------------- /docs/examples/locale/get.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const locale = new sdk.Locale(client); 9 | 10 | const result = await locale.get(); 11 | -------------------------------------------------------------------------------- /docs/examples/account/get.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.get(); 11 | -------------------------------------------------------------------------------- /docs/examples/health/get-cache.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getCache(); 11 | -------------------------------------------------------------------------------- /docs/examples/health/get-pub-sub.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getPubSub(); 11 | -------------------------------------------------------------------------------- /docs/examples/health/get-antivirus.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getAntivirus(); 11 | -------------------------------------------------------------------------------- /docs/examples/health/get-storage.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getStorage(); 11 | -------------------------------------------------------------------------------- /docs/examples/sites/list-frameworks.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.listFrameworks(); 11 | -------------------------------------------------------------------------------- /docs/examples/account/get-prefs.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.getPrefs(); 11 | -------------------------------------------------------------------------------- /docs/examples/locale/list-codes.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const locale = new sdk.Locale(client); 9 | 10 | const result = await locale.listCodes(); 11 | -------------------------------------------------------------------------------- /docs/examples/health/get-storage-local.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getStorageLocal(); 11 | -------------------------------------------------------------------------------- /docs/examples/locale/list-countries.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const locale = new sdk.Locale(client); 9 | 10 | const result = await locale.listCountries(); 11 | -------------------------------------------------------------------------------- /docs/examples/locale/list-languages.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const locale = new sdk.Locale(client); 9 | 10 | const result = await locale.listLanguages(); 11 | -------------------------------------------------------------------------------- /docs/examples/sites/list-specifications.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.listSpecifications(); 11 | -------------------------------------------------------------------------------- /docs/examples/account/create-mfa-challenge.md: -------------------------------------------------------------------------------- 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(''); // Your project ID 6 | 7 | const account = new sdk.Account(client); 8 | 9 | const result = await account.createMFAChallenge({ 10 | factor: sdk.AuthenticationFactor.Email 11 | }); 12 | -------------------------------------------------------------------------------- /docs/examples/account/create-session.md: -------------------------------------------------------------------------------- 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(''); // Your project ID 6 | 7 | const account = new sdk.Account(client); 8 | 9 | const result = await account.createSession({ 10 | userId: '', 11 | secret: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/account/list-sessions.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.listSessions(); 11 | -------------------------------------------------------------------------------- /docs/examples/account/update-status.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.updateStatus(); 11 | -------------------------------------------------------------------------------- /docs/examples/functions/list-runtimes.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.listRuntimes(); 11 | -------------------------------------------------------------------------------- /docs/examples/locale/list-continents.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const locale = new sdk.Locale(client); 9 | 10 | const result = await locale.listContinents(); 11 | -------------------------------------------------------------------------------- /docs/examples/locale/list-countries-eu.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const locale = new sdk.Locale(client); 9 | 10 | const result = await locale.listCountriesEU(); 11 | -------------------------------------------------------------------------------- /docs/examples/locale/list-currencies.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const locale = new sdk.Locale(client); 9 | 10 | const result = await locale.listCurrencies(); 11 | -------------------------------------------------------------------------------- /docs/examples/sites/get.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.get({ 11 | siteId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/users/get.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.get({ 11 | userId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/account/delete-sessions.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.deleteSessions(); 11 | -------------------------------------------------------------------------------- /docs/examples/account/list-mfa-factors.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.listMFAFactors(); 11 | -------------------------------------------------------------------------------- /docs/examples/graphql/query.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const graphql = new sdk.Graphql(client); 9 | 10 | const result = await graphql.query({ 11 | query: {} 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/sites/delete.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.delete({ 11 | siteId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/tokens/get.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tokens = new sdk.Tokens(client); 9 | 10 | const result = await tokens.get({ 11 | tokenId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/users/delete.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.delete({ 11 | userId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/account/create-phone-token.md: -------------------------------------------------------------------------------- 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(''); // Your project ID 6 | 7 | const account = new sdk.Account(client); 8 | 9 | const result = await account.createPhoneToken({ 10 | userId: '', 11 | phone: '+12065550100' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/account/update-phone-session.md: -------------------------------------------------------------------------------- 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(''); // Your project ID 6 | 7 | const account = new sdk.Account(client); 8 | 9 | const result = await account.updatePhoneSession({ 10 | userId: '', 11 | secret: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/functions/list-specifications.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.listSpecifications(); 11 | -------------------------------------------------------------------------------- /docs/examples/graphql/mutation.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const graphql = new sdk.Graphql(client); 9 | 10 | const result = await graphql.mutation({ 11 | query: {} 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/locale/list-countries-phones.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const locale = new sdk.Locale(client); 9 | 10 | const result = await locale.listCountriesPhones(); 11 | -------------------------------------------------------------------------------- /docs/examples/teams/get.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const teams = new sdk.Teams(client); 9 | 10 | const result = await teams.get({ 11 | teamId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/users/get-prefs.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.getPrefs({ 11 | userId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/account/get-mfa-recovery-codes.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.getMFARecoveryCodes(); 11 | -------------------------------------------------------------------------------- /docs/examples/teams/delete.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const teams = new sdk.Teams(client); 9 | 10 | const result = await teams.delete({ 11 | teamId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/tokens/delete.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tokens = new sdk.Tokens(client); 9 | 10 | const result = await tokens.delete({ 11 | tokenId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/account/create-mfa-recovery-codes.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.createMFARecoveryCodes(); 11 | -------------------------------------------------------------------------------- /docs/examples/account/create-phone-verification.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.createPhoneVerification(); 11 | -------------------------------------------------------------------------------- /docs/examples/account/update-magic-url-session.md: -------------------------------------------------------------------------------- 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(''); // Your project ID 6 | 7 | const account = new sdk.Account(client); 8 | 9 | const result = await account.updateMagicURLSession({ 10 | userId: '', 11 | secret: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/account/update-mfa-recovery-codes.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.updateMFARecoveryCodes(); 11 | -------------------------------------------------------------------------------- /docs/examples/account/update-mfa.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.updateMFA({ 11 | mfa: false 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/sites/list-variables.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.listVariables({ 11 | siteId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/get.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.get({ 11 | databaseId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/teams/get-prefs.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const teams = new sdk.Teams(client); 9 | 10 | const result = await teams.getPrefs({ 11 | teamId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/users/create-session.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.createSession({ 11 | userId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /src/enums/browser.ts: -------------------------------------------------------------------------------- 1 | export enum Browser { 2 | AvantBrowser = 'aa', 3 | AndroidWebViewBeta = 'an', 4 | GoogleChrome = 'ch', 5 | GoogleChromeIOS = 'ci', 6 | GoogleChromeMobile = 'cm', 7 | Chromium = 'cr', 8 | MozillaFirefox = 'ff', 9 | Safari = 'sf', 10 | MobileSafari = 'mf', 11 | MicrosoftEdge = 'ps', 12 | MicrosoftEdgeIOS = 'oi', 13 | OperaMini = 'om', 14 | Opera = 'op', 15 | OperaNext = 'on', 16 | } -------------------------------------------------------------------------------- /docs/examples/account/update-name.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.updateName({ 11 | name: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/databases/get.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.get({ 11 | databaseId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/functions/get.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.get({ 11 | functionId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/storage/get-bucket.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const storage = new sdk.Storage(client); 9 | 10 | const result = await storage.getBucket({ 11 | bucketId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/delete.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.delete({ 11 | databaseId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/users/delete-sessions.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.deleteSessions({ 11 | userId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/users/list-mfa-factors.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.listMFAFactors({ 11 | userId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/databases/delete.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.delete({ 11 | databaseId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/functions/delete.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.delete({ 11 | functionId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-certificate.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getCertificate({ 11 | domain: '' // optional 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/messaging/delete.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.delete({ 11 | messageId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/messaging/get-topic.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.getTopic({ 11 | topicId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/storage/delete-bucket.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const storage = new sdk.Storage(client); 9 | 10 | const result = await storage.deleteBucket({ 11 | bucketId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/users/delete-identity.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.deleteIdentity({ 11 | identityId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-builds.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getQueueBuilds({ 11 | threshold: null // optional 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-logs.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getQueueLogs({ 11 | threshold: null // optional 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-mails.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getQueueMails({ 11 | threshold: null // optional 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-usage.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getQueueUsage({ 11 | threshold: null // optional 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/messaging/delete-topic.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.deleteTopic({ 11 | topicId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/sites/get-log.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.getLog({ 11 | siteId: '', 12 | logId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/users/get-mfa-recovery-codes.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.getMFARecoveryCodes({ 11 | userId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/users/update-mfa.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.updateMFA({ 11 | userId: '', 12 | mfa: false 13 | }); 14 | -------------------------------------------------------------------------------- /src/enums/framework.ts: -------------------------------------------------------------------------------- 1 | export enum Framework { 2 | Analog = 'analog', 3 | Angular = 'angular', 4 | Nextjs = 'nextjs', 5 | React = 'react', 6 | Nuxt = 'nuxt', 7 | Vue = 'vue', 8 | Sveltekit = 'sveltekit', 9 | Astro = 'astro', 10 | Tanstackstart = 'tanstack-start', 11 | Remix = 'remix', 12 | Lynx = 'lynx', 13 | Flutter = 'flutter', 14 | Reactnative = 'react-native', 15 | Vite = 'vite', 16 | Other = 'other', 17 | } -------------------------------------------------------------------------------- /docs/examples/account/create-email-password-session.md: -------------------------------------------------------------------------------- 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(''); // Your project ID 6 | 7 | const account = new sdk.Account(client); 8 | 9 | const result = await account.createEmailPasswordSession({ 10 | email: 'email@example.com', 11 | password: 'password' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/account/get-session.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.getSession({ 11 | sessionId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/avatars/get-favicon.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const avatars = new sdk.Avatars(client); 9 | 10 | const result = await avatars.getFavicon({ 11 | url: 'https://example.com' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-deletes.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getQueueDeletes({ 11 | threshold: null // optional 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-webhooks.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getQueueWebhooks({ 11 | threshold: null // optional 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/messaging/get-message.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.getMessage({ 11 | messageId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/messaging/get-provider.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.getProvider({ 11 | providerId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/sites/delete-log.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.deleteLog({ 11 | siteId: '', 12 | logId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-transaction.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.createTransaction({ 11 | ttl: 60 // optional 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/users/create-mfa-recovery-codes.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.createMFARecoveryCodes({ 11 | userId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/users/update-labels.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.updateLabels({ 11 | userId: '', 12 | labels: [] 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/users/update-mfa-recovery-codes.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.updateMFARecoveryCodes({ 11 | userId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/users/update-name.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.updateName({ 11 | userId: '', 12 | name: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/users/update-prefs.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.updatePrefs({ 11 | userId: '', 12 | prefs: {} 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/account/delete-session.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.deleteSession({ 11 | sessionId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/account/update-session.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.updateSession({ 11 | sessionId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/databases/create-transaction.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.createTransaction({ 11 | ttl: 60 // optional 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/functions/list-variables.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.listVariables({ 11 | functionId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-functions.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getQueueFunctions({ 11 | threshold: null // optional 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-messaging.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getQueueMessaging({ 11 | threshold: null // optional 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-migrations.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getQueueMigrations({ 11 | threshold: null // optional 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/list-transactions.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.listTransactions({ 11 | queries: [] // optional 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/teams/update-prefs.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const teams = new sdk.Teams(client); 9 | 10 | const result = await teams.updatePrefs({ 11 | teamId: '', 12 | prefs: {} 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/tokens/update.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tokens = new sdk.Tokens(client); 9 | 10 | const result = await tokens.update({ 11 | tokenId: '', 12 | expire: '' // optional 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/users/update-password.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.updatePassword({ 11 | userId: '', 12 | password: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/users/update-status.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.updateStatus({ 11 | userId: '', 12 | status: false 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/account/create-email-token.md: -------------------------------------------------------------------------------- 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(''); // Your project ID 6 | 7 | const account = new sdk.Account(client); 8 | 9 | const result = await account.createEmailToken({ 10 | userId: '', 11 | email: 'email@example.com', 12 | phrase: false // optional 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/account/delete-identity.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.deleteIdentity({ 11 | identityId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/databases/list-transactions.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.listTransactions({ 11 | queries: [] // optional 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-certificates.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getQueueCertificates({ 11 | threshold: null // optional 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/messaging/delete-provider.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.deleteProvider({ 11 | providerId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/get-transaction.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.getTransaction({ 11 | transactionId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/teams/update-name.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const teams = new sdk.Teams(client); 9 | 10 | const result = await teams.updateName({ 11 | teamId: '', 12 | name: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/users/get-target.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.getTarget({ 11 | userId: '', 12 | targetId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/users/update-phone.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.updatePhone({ 11 | userId: '', 12 | number: '+12065550100' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/account/create-verification.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.createVerification({ 11 | url: 'https://example.com' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/account/create.md: -------------------------------------------------------------------------------- 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(''); // Your project ID 6 | 7 | const account = new sdk.Account(client); 8 | 9 | const result = await account.create({ 10 | userId: '', 11 | email: 'email@example.com', 12 | password: '', 13 | name: '' // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/databases/get-transaction.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.getTransaction({ 11 | transactionId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-stats-resources.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getQueueStatsResources({ 11 | threshold: null // optional 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/sites/get-variable.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.getVariable({ 11 | siteId: '', 12 | variableId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/delete-transaction.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.deleteTransaction({ 11 | transactionId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/users/delete-target.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.deleteTarget({ 11 | userId: '', 12 | targetId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/users/list-sessions.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.listSessions({ 11 | userId: '', 12 | total: false // optional 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/users/update-email.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.updateEmail({ 11 | userId: '', 12 | email: 'email@example.com' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/databases/delete-transaction.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.deleteTransaction({ 11 | transactionId: '' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/sites/delete-variable.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.deleteVariable({ 11 | siteId: '', 12 | variableId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/storage/get-file.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const storage = new sdk.Storage(client); 9 | 10 | const result = await storage.getFile({ 11 | bucketId: '', 12 | fileId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/users/delete-session.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.deleteSession({ 11 | userId: '', 12 | sessionId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /src/enums/name.ts: -------------------------------------------------------------------------------- 1 | export enum Name { 2 | V1database = 'v1-database', 3 | V1deletes = 'v1-deletes', 4 | V1audits = 'v1-audits', 5 | V1mails = 'v1-mails', 6 | V1functions = 'v1-functions', 7 | V1statsresources = 'v1-stats-resources', 8 | V1statsusage = 'v1-stats-usage', 9 | V1webhooks = 'v1-webhooks', 10 | V1certificates = 'v1-certificates', 11 | V1builds = 'v1-builds', 12 | V1messaging = 'v1-messaging', 13 | V1migrations = 'v1-migrations', 14 | } -------------------------------------------------------------------------------- /docs/examples/account/create-email-verification.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.createEmailVerification({ 11 | url: 'https://example.com' 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/account/list-logs.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.listLogs({ 11 | queries: [], // optional 12 | total: false // optional 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/account/update-phone.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.updatePhone({ 11 | phone: '+12065550100', 12 | password: 'password' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/sites/get-deployment.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.getDeployment({ 11 | siteId: '', 12 | deploymentId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/storage/delete-file.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const storage = new sdk.Storage(client); 9 | 10 | const result = await storage.deleteFile({ 11 | bucketId: '', 12 | fileId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/get-table.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.getTable({ 11 | databaseId: '', 12 | tableId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/account/create-mfa-authenticator.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.createMFAAuthenticator({ 11 | type: sdk.AuthenticatorType.Totp 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/account/delete-mfa-authenticator.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.deleteMFAAuthenticator({ 11 | type: sdk.AuthenticatorType.Totp 12 | }); 13 | -------------------------------------------------------------------------------- /docs/examples/account/update-email.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.updateEmail({ 11 | email: 'email@example.com', 12 | password: 'password' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/health/get-failed-jobs.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getFailedJobs({ 11 | name: sdk.Name.V1Database, 12 | threshold: null // optional 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/sites/delete-deployment.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.deleteDeployment({ 11 | siteId: '', 12 | deploymentId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/delete-table.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.deleteTable({ 11 | databaseId: '', 12 | tableId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/teams/create.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const teams = new sdk.Teams(client); 9 | 10 | const result = await teams.create({ 11 | teamId: '', 12 | name: '', 13 | roles: [] // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/teams/get-membership.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const teams = new sdk.Teams(client); 9 | 10 | const result = await teams.getMembership({ 11 | teamId: '', 12 | membershipId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/account/update-verification.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.updateVerification({ 11 | userId: '', 12 | secret: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/account/list-identities.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.listIdentities({ 11 | queries: [], // optional 12 | total: false // optional 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/account/update-mfa-challenge.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.updateMFAChallenge({ 11 | challengeId: '', 12 | otp: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/account/update-password.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.updatePassword({ 11 | password: '', 12 | oldPassword: 'password' // optional 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/functions/get-variable.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.getVariable({ 11 | functionId: '', 12 | variableId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/health/get-queue-databases.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const health = new sdk.Health(client); 9 | 10 | const result = await health.getQueueDatabases({ 11 | name: '', // optional 12 | threshold: null // optional 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/messaging/get-subscriber.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.getSubscriber({ 11 | topicId: '', 12 | subscriberId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/sites/list-logs.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.listLogs({ 11 | siteId: '', 12 | queries: [], // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/sites/update-site-deployment.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.updateSiteDeployment({ 11 | siteId: '', 12 | deploymentId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/get-index.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.getIndex({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '' 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/teams/delete-membership.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const teams = new sdk.Teams(client); 9 | 10 | const result = await teams.deleteMembership({ 11 | teamId: '', 12 | membershipId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/users/list-logs.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.listLogs({ 11 | userId: '', 12 | queries: [], // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/users/update-email-verification.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.updateEmailVerification({ 11 | userId: '', 12 | emailVerification: false 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/users/update-phone-verification.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.updatePhoneVerification({ 11 | userId: '', 12 | phoneVerification: false 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/account/create-recovery.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.createRecovery({ 11 | email: 'email@example.com', 12 | url: 'https://example.com' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/functions/delete-variable.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.deleteVariable({ 11 | functionId: '', 12 | variableId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/sites/list.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.list({ 11 | queries: [], // optional 12 | search: '', // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/sites/update-deployment-status.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.updateDeploymentStatus({ 11 | siteId: '', 12 | deploymentId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/get-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.getColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '' 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/users/create-token.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.createToken({ 11 | userId: '', 12 | length: 4, // optional 13 | expire: 60 // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/users/delete-mfa-authenticator.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.deleteMFAAuthenticator({ 11 | userId: '', 12 | type: sdk.AuthenticatorType.Totp 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/users/list-targets.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.listTargets({ 11 | userId: '', 12 | queries: [], // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/users/list.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.list({ 11 | queries: [], // optional 12 | search: '', // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/account/update-email-verification.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.updateEmailVerification({ 11 | userId: '', 12 | secret: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/account/update-phone-verification.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.updatePhoneVerification({ 11 | userId: '', 12 | secret: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/account/update-recovery.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.updateRecovery({ 11 | userId: '', 12 | secret: '', 13 | password: '' 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/databases/get-collection.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.getCollection({ 11 | databaseId: '', 12 | collectionId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/functions/delete-execution.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.deleteExecution({ 11 | functionId: '', 12 | executionId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/functions/get-deployment.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.getDeployment({ 11 | functionId: '', 12 | deploymentId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/functions/get-execution.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.getExecution({ 11 | functionId: '', 12 | executionId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/messaging/delete-subscriber.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setJWT(''); // Your secret JSON Web Token 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.deleteSubscriber({ 11 | topicId: '', 12 | subscriberId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/sites/create-duplicate-deployment.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.createDuplicateDeployment({ 11 | siteId: '', 12 | deploymentId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.create({ 11 | databaseId: '', 12 | name: '', 13 | enabled: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/delete-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.deleteColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '' 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/delete-index.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.deleteIndex({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '' 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.update({ 11 | databaseId: '', 12 | name: '', 13 | enabled: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/teams/list.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const teams = new sdk.Teams(client); 9 | 10 | const result = await teams.list({ 11 | queries: [], // optional 12 | search: '', // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/account/update-mfa-authenticator.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.updateMFAAuthenticator({ 11 | type: sdk.AuthenticatorType.Totp, 12 | otp: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/databases/create.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.create({ 11 | databaseId: '', 12 | name: '', 13 | enabled: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/databases/delete-collection.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.deleteCollection({ 11 | databaseId: '', 12 | collectionId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/databases/get-index.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.getIndex({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '' 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/databases/update.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.update({ 11 | databaseId: '', 12 | name: '', 13 | enabled: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/functions/delete-deployment.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.deleteDeployment({ 11 | functionId: '', 12 | deploymentId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/list.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.list({ 11 | queries: [], // optional 12 | search: '', // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/users/create-jwt.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.createJWT({ 11 | userId: '', 12 | sessionId: '', // optional 13 | duration: 0 // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/avatars/get-image.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const avatars = new sdk.Avatars(client); 9 | 10 | const result = await avatars.getImage({ 11 | url: 'https://example.com', 12 | width: 0, // optional 13 | height: 0 // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/databases/delete-index.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.deleteIndex({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '' 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/databases/list.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.list({ 11 | queries: [], // optional 12 | search: '', // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/functions/list.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.list({ 11 | queries: [], // optional 12 | search: '', // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/messaging/create-topic.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.createTopic({ 11 | topicId: '', 12 | name: '', 13 | subscribe: ["any"] // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/teams/update-membership.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const teams = new sdk.Teams(client); 9 | 10 | const result = await teams.updateMembership({ 11 | teamId: '', 12 | membershipId: '', 13 | roles: [] 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/tokens/create-file-token.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tokens = new sdk.Tokens(client); 9 | 10 | const result = await tokens.createFileToken({ 11 | bucketId: '', 12 | fileId: '', 13 | expire: '' // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/databases/get-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.getAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '' 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/functions/update-deployment-status.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.updateDeploymentStatus({ 11 | functionId: '', 12 | deploymentId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/storage/list-buckets.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const storage = new sdk.Storage(client); 9 | 10 | const result = await storage.listBuckets({ 11 | queries: [], // optional 12 | search: '', // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/users/list-identities.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.listIdentities({ 11 | queries: [], // optional 12 | search: '', // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/account/create-magic-url-token.md: -------------------------------------------------------------------------------- 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(''); // Your project ID 6 | 7 | const account = new sdk.Account(client); 8 | 9 | const result = await account.createMagicURLToken({ 10 | userId: '', 11 | email: 'email@example.com', 12 | url: 'https://example.com', // optional 13 | phrase: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/databases/delete-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.deleteAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '' 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/functions/update-function-deployment.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.updateFunctionDeployment({ 11 | functionId: '', 12 | deploymentId: '' 13 | }); 14 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-targets.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.listTargets({ 11 | messageId: '', 12 | queries: [], // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-topic-logs.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.listTopicLogs({ 11 | topicId: '', 12 | queries: [], // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-topics.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.listTopics({ 11 | queries: [], // optional 12 | search: '', // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/sites/create-variable.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.createVariable({ 11 | siteId: '', 12 | key: '', 13 | value: '', 14 | secret: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/storage/get-file-view.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const storage = new sdk.Storage(client); 9 | 10 | const result = await storage.getFileView({ 11 | bucketId: '', 12 | fileId: '', 13 | token: '' // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/tokens/list.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tokens = new sdk.Tokens(client); 9 | 10 | const result = await tokens.list({ 11 | bucketId: '', 12 | fileId: '', 13 | queries: [], // optional 14 | total: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/avatars/get-qr.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const avatars = new sdk.Avatars(client); 9 | 10 | const result = await avatars.getQR({ 11 | text: '', 12 | size: 1, // optional 13 | margin: 0, // optional 14 | download: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-messages.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.listMessages({ 11 | queries: [], // optional 12 | search: '', // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/messaging/update-topic.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.updateTopic({ 11 | topicId: '', 12 | name: '', // optional 13 | subscribe: ["any"] // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/storage/get-file-download.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const storage = new sdk.Storage(client); 9 | 10 | const result = await storage.getFileDownload({ 11 | bucketId: '', 12 | fileId: '', 13 | token: '' // optional 14 | }); 15 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "esModuleInterop": true, 4 | "skipLibCheck": true, 5 | "target": "es2017", 6 | "allowJs": true, 7 | "resolveJsonModule": true, 8 | "moduleDetection": "force", 9 | "isolatedModules": true, 10 | "strict": true, 11 | "module": "es2022", 12 | "moduleResolution": "Bundler", 13 | "lib": ["es2022"] 14 | }, 15 | "compileOnSave": false, 16 | "exclude": ["node_modules", "dist"], 17 | "include": ["src"] 18 | } -------------------------------------------------------------------------------- /docs/examples/messaging/list-message-logs.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.listMessageLogs({ 11 | messageId: '', 12 | queries: [], // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-provider-logs.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.listProviderLogs({ 11 | providerId: '', 12 | queries: [], // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-providers.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.listProviders({ 11 | queries: [], // optional 12 | search: '', // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/functions/list-executions.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.listExecutions({ 11 | functionId: '', 12 | queries: [], // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/messaging/create-subscriber.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setJWT(''); // Your secret JSON Web Token 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.createSubscriber({ 11 | topicId: '', 12 | subscriberId: '', 13 | targetId: '' 14 | }); 15 | -------------------------------------------------------------------------------- /src/enums/credit-card.ts: -------------------------------------------------------------------------------- 1 | export enum CreditCard { 2 | AmericanExpress = 'amex', 3 | Argencard = 'argencard', 4 | Cabal = 'cabal', 5 | Cencosud = 'cencosud', 6 | DinersClub = 'diners', 7 | Discover = 'discover', 8 | Elo = 'elo', 9 | Hipercard = 'hipercard', 10 | JCB = 'jcb', 11 | Mastercard = 'mastercard', 12 | Naranja = 'naranja', 13 | TarjetaShopping = 'targeta-shopping', 14 | UnionPay = 'unionpay', 15 | Visa = 'visa', 16 | MIR = 'mir', 17 | Maestro = 'maestro', 18 | Rupay = 'rupay', 19 | } -------------------------------------------------------------------------------- /docs/examples/account/update-prefs.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const account = new sdk.Account(client); 9 | 10 | const result = await account.updatePrefs({ 11 | prefs: { 12 | "language": "en", 13 | "timezone": "UTC", 14 | "darkTheme": true 15 | } 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/avatars/get-flag.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const avatars = new sdk.Avatars(client); 9 | 10 | const result = await avatars.getFlag({ 11 | code: sdk.Flag.Afghanistan, 12 | width: 0, // optional 13 | height: 0, // optional 14 | quality: -1 // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-subscriber-logs.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.listSubscriberLogs({ 11 | subscriberId: '', 12 | queries: [], // optional 13 | total: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-transaction.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updateTransaction({ 11 | transactionId: '', 12 | commit: false, // optional 13 | rollback: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/users/create-md-5-user.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.createMD5User({ 11 | userId: '', 12 | email: 'email@example.com', 13 | password: 'password', 14 | name: '' // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/account/create-o-auth-2-token.md: -------------------------------------------------------------------------------- 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(''); // Your project ID 6 | 7 | const account = new sdk.Account(client); 8 | 9 | const result = await account.createOAuth2Token({ 10 | provider: sdk.OAuthProvider.Amazon, 11 | success: 'https://example.com', // optional 12 | failure: 'https://example.com', // optional 13 | scopes: [] // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/databases/update-transaction.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.updateTransaction({ 11 | transactionId: '', 12 | commit: false, // optional 13 | rollback: false // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/functions/create-variable.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.createVariable({ 11 | functionId: '', 12 | key: '', 13 | value: '', 14 | secret: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/sites/list-deployments.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.listDeployments({ 11 | siteId: '', 12 | queries: [], // optional 13 | search: '', // optional 14 | total: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/users/create-argon-2-user.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.createArgon2User({ 11 | userId: '', 12 | email: 'email@example.com', 13 | password: 'password', 14 | name: '' // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/users/create-bcrypt-user.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.createBcryptUser({ 11 | userId: '', 12 | email: 'email@example.com', 13 | password: 'password', 14 | name: '' // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/users/create-ph-pass-user.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.createPHPassUser({ 11 | userId: '', 12 | email: 'email@example.com', 13 | password: 'password', 14 | name: '' // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/users/list-memberships.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.listMemberships({ 11 | userId: '', 12 | queries: [], // optional 13 | search: '', // optional 14 | total: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/avatars/get-browser.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const avatars = new sdk.Avatars(client); 9 | 10 | const result = await avatars.getBrowser({ 11 | code: sdk.Browser.AvantBrowser, 12 | width: 0, // optional 13 | height: 0, // optional 14 | quality: -1 // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/avatars/get-initials.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const avatars = new sdk.Avatars(client); 9 | 10 | const result = await avatars.getInitials({ 11 | name: '', // optional 12 | width: 0, // optional 13 | height: 0, // optional 14 | background: '' // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/list-columns.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.listColumns({ 11 | databaseId: '', 12 | tableId: '', 13 | queries: [], // optional 14 | total: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/list-indexes.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.listIndexes({ 11 | databaseId: '', 12 | tableId: '', 13 | queries: [], // optional 14 | total: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/sites/get-deployment-download.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.getDeploymentDownload({ 11 | siteId: '', 12 | deploymentId: '', 13 | type: sdk.DeploymentDownloadType.Source // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/storage/list-files.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const storage = new sdk.Storage(client); 9 | 10 | const result = await storage.listFiles({ 11 | bucketId: '', 12 | queries: [], // optional 13 | search: '', // optional 14 | total: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-rows.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.createRows({ 11 | databaseId: '', 12 | tableId: '', 13 | rows: [], 14 | transactionId: '' // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/list-tables.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.listTables({ 11 | databaseId: '', 12 | queries: [], // optional 13 | search: '', // optional 14 | total: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/upsert-rows.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.upsertRows({ 11 | databaseId: '', 12 | tableId: '', 13 | rows: [], 14 | transactionId: '' // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/teams/list-memberships.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const teams = new sdk.Teams(client); 9 | 10 | const result = await teams.listMemberships({ 11 | teamId: '', 12 | queries: [], // optional 13 | search: '', // optional 14 | total: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/sites/create-vcs-deployment.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.createVcsDeployment({ 11 | siteId: '', 12 | type: sdk.VCSReferenceType.Branch, 13 | reference: '', 14 | activate: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/teams/update-membership-status.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const teams = new sdk.Teams(client); 9 | 10 | const result = await teams.updateMembershipStatus({ 11 | teamId: '', 12 | membershipId: '', 13 | userId: '', 14 | secret: '' 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/avatars/get-credit-card.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const avatars = new sdk.Avatars(client); 9 | 10 | const result = await avatars.getCreditCard({ 11 | code: sdk.CreditCard.AmericanExpress, 12 | width: 0, // optional 13 | height: 0, // optional 14 | quality: -1 // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/databases/list-indexes.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.listIndexes({ 11 | databaseId: '', 12 | collectionId: '', 13 | queries: [], // optional 14 | total: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/functions/create-duplicate-deployment.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.createDuplicateDeployment({ 11 | functionId: '', 12 | deploymentId: '', 13 | buildId: '' // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/messaging/list-subscribers.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.listSubscribers({ 11 | topicId: '', 12 | queries: [], // optional 13 | search: '', // optional 14 | total: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/databases/list-attributes.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.listAttributes({ 11 | databaseId: '', 12 | collectionId: '', 13 | queries: [], // optional 14 | total: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/databases/list-collections.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.listCollections({ 11 | databaseId: '', 12 | queries: [], // optional 13 | search: '', // optional 14 | total: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/functions/list-deployments.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.listDeployments({ 11 | functionId: '', 12 | queries: [], // optional 13 | search: '', // optional 14 | total: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/messaging/create-fcm-provider.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.createFCMProvider({ 11 | providerId: '', 12 | name: '', 13 | serviceAccountJSON: {}, // optional 14 | enabled: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/sites/update-variable.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const sites = new sdk.Sites(client); 9 | 10 | const result = await sites.updateVariable({ 11 | siteId: '', 12 | variableId: '', 13 | key: '', 14 | value: '', // optional 15 | secret: false // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/delete-row.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.deleteRow({ 11 | databaseId: '', 12 | tableId: '', 13 | rowId: '', 14 | transactionId: '' // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/delete-rows.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.deleteRows({ 11 | databaseId: '', 12 | tableId: '', 13 | queries: [], // optional 14 | transactionId: '' // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/functions/get-deployment-download.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.getDeploymentDownload({ 11 | functionId: '', 12 | deploymentId: '', 13 | type: sdk.DeploymentDownloadType.Source // optional 14 | }); 15 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-point-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.createPointColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: [1, 2] // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/databases/create-documents.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.createDocuments({ 11 | databaseId: '', 12 | collectionId: '', 13 | documents: [], 14 | transactionId: '' // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/databases/upsert-documents.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.upsertDocuments({ 11 | databaseId: '', 12 | collectionId: '', 13 | documents: [], 14 | transactionId: '' // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/users/create.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.create({ 11 | userId: '', 12 | email: 'email@example.com', // optional 13 | phone: '+12065550100', // optional 14 | password: '', // optional 15 | name: '' // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/functions/create-vcs-deployment.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.createVcsDeployment({ 11 | functionId: '', 12 | type: sdk.VCSReferenceType.Branch, 13 | reference: '', 14 | activate: false // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/messaging/update-fcm-provider.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.updateFCMProvider({ 11 | providerId: '', 12 | name: '', // optional 13 | enabled: false, // optional 14 | serviceAccountJSON: {} // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/storage/update-file.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const storage = new sdk.Storage(client); 9 | 10 | const result = await storage.updateFile({ 11 | bucketId: '', 12 | fileId: '', 13 | name: '', // optional 14 | permissions: [sdk.Permission.read(sdk.Role.any())] // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-ip-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updateIpColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: '', 16 | newKey: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/databases/delete-documents.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.deleteDocuments({ 11 | databaseId: '', 12 | collectionId: '', 13 | queries: [], // optional 14 | transactionId: '' // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-line-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.createLineColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: [[1, 2], [3, 4], [5, 6]] // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/databases/create-point-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.createPointAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: [1, 2] // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/functions/update-variable.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const functions = new sdk.Functions(client); 9 | 10 | const result = await functions.updateVariable({ 11 | functionId: '', 12 | variableId: '', 13 | key: '', 14 | value: '', // optional 15 | secret: false // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/get-row.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.getRow({ 11 | databaseId: '', 12 | tableId: '', 13 | rowId: '', 14 | queries: [], // optional 15 | transactionId: '' // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/databases/delete-document.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.deleteDocument({ 11 | databaseId: '', 12 | collectionId: '', 13 | documentId: '', 14 | transactionId: '' // optional 15 | }); 16 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-ip-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.createIpColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: '', // optional 16 | array: false // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-boolean-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updateBooleanColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: false, 16 | newKey: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-datetime-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updateDatetimeColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: '', 16 | newKey: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-rows.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updateRows({ 11 | databaseId: '', 12 | tableId: '', 13 | data: {}, // optional 14 | queries: [], // optional 15 | transactionId: '' // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/users/create-sha-user.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.createSHAUser({ 11 | userId: '', 12 | email: 'email@example.com', 13 | password: 'password', 14 | passwordVersion: sdk.PasswordHash.Sha1, // optional 15 | name: '' // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/users/update-target.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.updateTarget({ 11 | userId: '', 12 | targetId: '', 13 | identifier: '', // optional 14 | providerId: '', // optional 15 | name: '' // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/databases/update-ip-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.updateIpAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: '', 16 | newKey: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-polygon-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.createPolygonColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/list-rows.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.listRows({ 11 | databaseId: '', 12 | tableId: '', 13 | queries: [], // optional 14 | transactionId: '', // optional 15 | total: false // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-url-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updateUrlColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: 'https://example.com', 16 | newKey: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/databases/create-line-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.createLineAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: [[1, 2], [3, 4], [5, 6]] // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-datetime-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.createDatetimeColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: '', // optional 16 | array: false // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-email-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updateEmailColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: 'email@example.com', 16 | newKey: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-point-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updatePointColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: [1, 2], // optional 16 | newKey: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-boolean-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.createBooleanColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: false, // optional 16 | array: false // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-relationship-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updateRelationshipColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | onDelete: sdk.RelationMutate.Cascade, // optional 15 | newKey: '' // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/databases/create-ip-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.createIpAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: '', // optional 16 | array: false // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/databases/update-boolean-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.updateBooleanAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: false, 16 | newKey: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/databases/update-datetime-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.updateDatetimeAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: '', 16 | newKey: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-index.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.createIndex({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | type: sdk.IndexType.Key, 15 | columns: [], 16 | orders: [], // optional 17 | lengths: [] // optional 18 | }); 19 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-url-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.createUrlColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: 'https://example.com', // optional 16 | array: false // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-enum-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updateEnumColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | elements: [], 15 | required: false, 16 | default: '', 17 | newKey: '' // optional 18 | }); 19 | -------------------------------------------------------------------------------- /docs/examples/databases/create-polygon-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.createPolygonAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/databases/update-documents.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.updateDocuments({ 11 | databaseId: '', 12 | collectionId: '', 13 | data: {}, // optional 14 | queries: [], // optional 15 | transactionId: '' // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/databases/update-url-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.updateUrlAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: 'https://example.com', 16 | newKey: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-email-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.createEmailColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: 'email@example.com', // optional 16 | array: false // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-line-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updateLineColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: [[1, 2], [3, 4], [5, 6]], // optional 16 | newKey: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/databases/create-datetime-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.createDatetimeAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: '', // optional 16 | array: false // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/databases/get-document.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.getDocument({ 11 | databaseId: '', 12 | collectionId: '', 13 | documentId: '', 14 | queries: [], // optional 15 | transactionId: '' // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/databases/list-documents.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.listDocuments({ 11 | databaseId: '', 12 | collectionId: '', 13 | queries: [], // optional 14 | transactionId: '', // optional 15 | total: false // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/databases/update-email-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.updateEmailAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: 'email@example.com', 16 | newKey: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/databases/update-point-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.updatePointAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: [1, 2], // optional 16 | newKey: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/databases/create-boolean-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.createBooleanAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: false, // optional 16 | array: false // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/databases/update-relationship-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.updateRelationshipAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | onDelete: sdk.RelationMutate.Cascade, // optional 15 | newKey: '' // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-enum-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.createEnumColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | elements: [], 15 | required: false, 16 | default: '', // optional 17 | array: false // optional 18 | }); 19 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-string-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updateStringColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: '', 16 | size: 1, // optional 17 | newKey: '' // optional 18 | }); 19 | -------------------------------------------------------------------------------- /docs/examples/databases/create-index.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.createIndex({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | type: sdk.IndexType.Key, 15 | attributes: [], 16 | orders: [], // optional 17 | lengths: [] // optional 18 | }); 19 | -------------------------------------------------------------------------------- /docs/examples/databases/create-url-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.createUrlAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: 'https://example.com', // optional 16 | array: false // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/databases/update-enum-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.updateEnumAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | elements: [], 15 | required: false, 16 | default: '', 17 | newKey: '' // optional 18 | }); 19 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-polygon-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updatePolygonColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional 16 | newKey: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/databases/create-email-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.createEmailAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: 'email@example.com', // optional 16 | array: false // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/databases/update-line-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.updateLineAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: [[1, 2], [3, 4], [5, 6]], // optional 16 | newKey: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/storage/create-file.md: -------------------------------------------------------------------------------- 1 | const sdk = require('node-appwrite'); 2 | const fs = require('fs'); 3 | 4 | const client = new sdk.Client() 5 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 6 | .setProject('') // Your project ID 7 | .setSession(''); // The user session to authenticate with 8 | 9 | const storage = new sdk.Storage(client); 10 | 11 | const result = await storage.createFile({ 12 | bucketId: '', 13 | fileId: '', 14 | file: InputFile.fromPath('/path/to/file', 'filename'), 15 | permissions: [sdk.Permission.read(sdk.Role.any())] // optional 16 | }); 17 | -------------------------------------------------------------------------------- /docs/examples/users/create-target.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const users = new sdk.Users(client); 9 | 10 | const result = await users.createTarget({ 11 | userId: '', 12 | targetId: '', 13 | providerType: sdk.MessagingProviderType.Email, 14 | identifier: '', 15 | providerId: '', // optional 16 | name: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/messaging/create-sms.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.createSMS({ 11 | messageId: '', 12 | content: '', 13 | topics: [], // optional 14 | users: [], // optional 15 | targets: [], // optional 16 | draft: false, // optional 17 | scheduledAt: '' // optional 18 | }); 19 | -------------------------------------------------------------------------------- /docs/examples/databases/create-enum-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.createEnumAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | elements: [], 15 | required: false, 16 | default: '', // optional 17 | array: false // optional 18 | }); 19 | -------------------------------------------------------------------------------- /docs/examples/databases/update-string-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.updateStringAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: '', 16 | size: 1, // optional 17 | newKey: '' // optional 18 | }); 19 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-table.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.createTable({ 11 | databaseId: '', 12 | tableId: '', 13 | name: '', 14 | permissions: [sdk.Permission.read(sdk.Role.any())], // optional 15 | rowSecurity: false, // optional 16 | enabled: false // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-table.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updateTable({ 11 | databaseId: '', 12 | tableId: '', 13 | name: '', 14 | permissions: [sdk.Permission.read(sdk.Role.any())], // optional 15 | rowSecurity: false, // optional 16 | enabled: false // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/databases/update-polygon-attribute.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const databases = new sdk.Databases(client); 9 | 10 | const result = await databases.updatePolygonAttribute({ 11 | databaseId: '', 12 | collectionId: '', 13 | key: '', 14 | required: false, 15 | default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional 16 | newKey: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/messaging/update-sms.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.updateSMS({ 11 | messageId: '', 12 | topics: [], // optional 13 | users: [], // optional 14 | targets: [], // optional 15 | content: '', // optional 16 | draft: false, // optional 17 | scheduledAt: '' // optional 18 | }); 19 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-float-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updateFloatColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: null, 16 | min: null, // optional 17 | max: null, // optional 18 | newKey: '' // optional 19 | }); 20 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-integer-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updateIntegerColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | default: null, 16 | min: null, // optional 17 | max: null, // optional 18 | newKey: '' // optional 19 | }); 20 | -------------------------------------------------------------------------------- /docs/examples/messaging/create-vonage-provider.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.createVonageProvider({ 11 | providerId: '', 12 | name: '', 13 | from: '+12065550100', // optional 14 | apiKey: '', // optional 15 | apiSecret: '', // optional 16 | enabled: false // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/messaging/create-msg-91-provider.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.createMsg91Provider({ 11 | providerId: '', 12 | name: '', 13 | templateId: '', // optional 14 | senderId: '', // optional 15 | authKey: '', // optional 16 | enabled: false // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/messaging/create-telesign-provider.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.createTelesignProvider({ 11 | providerId: '', 12 | name: '', 13 | from: '+12065550100', // optional 14 | customerId: '', // optional 15 | apiKey: '', // optional 16 | enabled: false // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/messaging/create-textmagic-provider.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.createTextmagicProvider({ 11 | providerId: '', 12 | name: '', 13 | from: '+12065550100', // optional 14 | username: '', // optional 15 | apiKey: '', // optional 16 | enabled: false // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/messaging/update-vonage-provider.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.updateVonageProvider({ 11 | providerId: '', 12 | name: '', // optional 13 | enabled: false, // optional 14 | apiKey: '', // optional 15 | apiSecret: '', // optional 16 | from: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-float-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.createFloatColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | required: false, 15 | min: null, // optional 16 | max: null, // optional 17 | default: null, // optional 18 | array: false // optional 19 | }); 20 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/create-string-column.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.createStringColumn({ 11 | databaseId: '', 12 | tableId: '', 13 | key: '', 14 | size: 1, 15 | required: false, 16 | default: '', // optional 17 | array: false, // optional 18 | encrypt: false // optional 19 | }); 20 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/update-row.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.updateRow({ 11 | databaseId: '', 12 | tableId: '', 13 | rowId: '', 14 | data: {}, // optional 15 | permissions: [sdk.Permission.read(sdk.Role.any())], // optional 16 | transactionId: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/tablesdb/upsert-row.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setSession(''); // The user session to authenticate with 7 | 8 | const tablesDB = new sdk.TablesDB(client); 9 | 10 | const result = await tablesDB.upsertRow({ 11 | databaseId: '', 12 | tableId: '', 13 | rowId: '', 14 | data: {}, // optional 15 | permissions: [sdk.Permission.read(sdk.Role.any())], // optional 16 | transactionId: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/functions/create-deployment.md: -------------------------------------------------------------------------------- 1 | const sdk = require('node-appwrite'); 2 | const fs = require('fs'); 3 | 4 | const client = new sdk.Client() 5 | .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint 6 | .setProject('') // Your project ID 7 | .setKey(''); // Your secret API key 8 | 9 | const functions = new sdk.Functions(client); 10 | 11 | const result = await functions.createDeployment({ 12 | functionId: '', 13 | code: InputFile.fromPath('/path/to/file', 'filename'), 14 | activate: false, 15 | entrypoint: '', // optional 16 | commands: '' // optional 17 | }); 18 | -------------------------------------------------------------------------------- /docs/examples/messaging/create-twilio-provider.md: -------------------------------------------------------------------------------- 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('') // Your project ID 6 | .setKey(''); // Your secret API key 7 | 8 | const messaging = new sdk.Messaging(client); 9 | 10 | const result = await messaging.createTwilioProvider({ 11 | providerId: '', 12 | name: '', 13 | from: '+12065550100', // optional 14 | accountSid: '', // optional 15 | authToken: '', // optional 16 | enabled: false // optional 17 | }); 18 | --------------------------------------------------------------------------------