From a64398dce4f99dbd70e9fff0738e2dec2dcec074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 25 Sep 2026 15:33:58 +0200 Subject: [PATCH] chore: update Node.js SDK to 30.0.0 Co-Authored-By: Claude Opus 5.5 (1M context) --- CHANGELOG.md | 19 + README.md | 4 +- ...gs.md => create-email-verification-otp.md} | 5 +- .../account/create-id-token-session.md | 19 + docs/examples/account/create-recovery-otp.md | 15 + .../account/update-email-verification-otp.md | 15 + docs/examples/account/update-recovery-otp.md | 16 + .../domains/create-preset-google-workspace.md | 14 + .../examples/domains/create-preset-i-cloud.md | 14 + .../examples/domains/create-preset-mailgun.md | 14 + .../examples/domains/create-preset-outlook.md | 14 + .../domains/create-preset-proton-mail.md | 14 + docs/examples/domains/create-preset-zoho.md | 14 + docs/examples/domains/create-record-a.md | 18 + docs/examples/domains/create-record-aaaa.md | 18 + docs/examples/domains/create-record-alias.md | 18 + docs/examples/domains/create-record-caa.md | 18 + docs/examples/domains/create-record-cname.md | 18 + docs/examples/domains/create-record-https.md | 18 + docs/examples/domains/create-record-mx.md | 19 + docs/examples/domains/create-record-ns.md | 18 + docs/examples/domains/create-record-srv.md | 21 + docs/examples/domains/create-record-txt.md | 18 + docs/examples/domains/create.md | 15 + docs/examples/domains/delete-record.md | 15 + docs/examples/domains/delete.md | 14 + .../domains/get-preset-google-workspace.md | 14 + docs/examples/domains/get-preset-i-cloud.md | 14 + docs/examples/domains/get-preset-mailgun.md | 14 + docs/examples/domains/get-preset-outlook.md | 14 + .../domains/get-preset-proton-mail.md | 14 + docs/examples/domains/get-preset-zoho.md | 14 + docs/examples/domains/get-price.md | 16 + docs/examples/domains/get-record.md | 15 + docs/examples/domains/get-transfer-status.md | 14 + docs/examples/domains/get-zone.md | 14 + docs/examples/domains/get.md | 14 + docs/examples/domains/list-prices.md | 16 + .../list-logs.md => domains/list-records.md} | 7 +- docs/examples/domains/list.md | 15 + docs/examples/domains/update-nameservers.md | 15 + docs/examples/domains/update-record-a.md | 19 + docs/examples/domains/update-record-aaaa.md | 19 + docs/examples/domains/update-record-alias.md | 19 + docs/examples/domains/update-record-caa.md | 19 + docs/examples/domains/update-record-cname.md | 19 + docs/examples/domains/update-record-https.md | 19 + docs/examples/domains/update-record-mx.md | 20 + docs/examples/domains/update-record-ns.md | 19 + docs/examples/domains/update-record-srv.md | 22 + docs/examples/domains/update-record-txt.md | 19 + docs/examples/domains/update-team.md | 15 + docs/examples/domains/update-zone.md | 15 + docs/examples/domains/verify-nameservers.md | 14 + .../messaging/create-appwrite-provider.md | 18 + docs/examples/messaging/create-email.md | 2 + docs/examples/messaging/create-topic.md | 2 + .../messaging/create-twilio-provider.md | 2 +- .../messaging/update-appwrite-provider.md | 18 + docs/examples/messaging/update-email.md | 2 + docs/examples/messaging/update-topic.md | 2 + docs/examples/oauth2/approve.md | 4 +- docs/examples/oauth2/authorize-post.md | 4 +- docs/examples/oauth2/authorize.md | 4 +- .../oauth2/create-device-authorization.md | 4 +- docs/examples/oauth2/create-grant.md | 4 +- docs/examples/oauth2/create-par.md | 4 +- docs/examples/oauth2/create-token.md | 4 +- docs/examples/oauth2/get-grant.md | 4 +- docs/examples/oauth2/introspect.md | 17 + docs/examples/oauth2/list-organizations.md | 4 +- docs/examples/oauth2/list-projects.md | 4 +- docs/examples/oauth2/reject.md | 4 +- docs/examples/oauth2/revoke.md | 4 +- ...key.md => create-ephemeral-project-key.md} | 9 +- .../{get-key.md => delete-project-key.md} | 3 +- .../{delete-key.md => get-project-key.md} | 3 +- .../{list-keys.md => list-project-keys.md} | 3 +- .../{update-key.md => update-project-key.md} | 5 +- .../examples/project/update-o-auth-2-apple.md | 2 + .../project/update-o-auth-2-google.md | 2 + .../examples/project/update-o-auth-2-kakao.md | 16 + .../project/update-o-auth-2-tik-tok.md | 16 + .../project/update-password-pwned-policy.md | 16 + docs/examples/storage/get-file-preview.md | 2 +- package-lock.json | 2533 +++++---- package.json | 8 +- src/client.ts | 21 +- src/enums/billing-plan-group.ts | 3 +- src/enums/build-runtime.ts | 2 + src/enums/domain-registration-type.ts | 6 + src/enums/domain-transfer-status-enum.ts | 10 + src/enums/framework.ts | 1 + src/enums/id-token-provider.ts | 4 + src/enums/image-gravity.ts | 1 + src/enums/o-auth-provider.ts | 2 + src/enums/organization-key-scopes.ts | 18 - src/enums/project-email-template-id.ts | 2 + src/enums/project-key-scopes.ts | 1 + src/enums/project-o-auth-provider-id.ts | 2 + src/enums/project-policy-id.ts | 1 + src/enums/runtime.ts | 2 + src/index.ts | 5 +- src/models.ts | 726 ++- src/services/account.ts | 569 +- src/services/activities.ts | 4 +- src/services/advisor.ts | 13 +- src/services/apps.ts | 56 +- src/services/avatars.ts | 4 +- src/services/backups.ts | 18 +- src/services/databases.ts | 350 +- src/services/documents-db.ts | 135 +- src/services/domains.ts | 4647 +++++++++++++++++ src/services/functions.ts | 70 +- src/services/messaging.ts | 461 +- src/services/mongo.ts | 78 +- src/services/mysql.ts | 84 +- src/services/oauth-2.ts | 117 +- src/services/organization.ts | 1036 ++-- src/services/postgresql.ts | 92 +- src/services/presences.ts | 11 +- src/services/project.ts | 503 +- src/services/proxy.ts | 9 +- src/services/sites.ts | 67 +- src/services/storage.ts | 42 +- src/services/tables-db.ts | 614 +-- src/services/teams.ts | 50 +- src/services/tokens.ts | 15 +- src/services/users.ts | 188 +- src/services/vectors-db.ts | 123 +- src/services/webhooks.ts | 11 +- test/services/account.test.js | 131 +- test/services/documents-d-b.test.js | 5 +- test/services/domains.test.js | 1003 ++++ test/services/functions.test.js | 4 +- test/services/messaging.test.js | 42 + test/services/mongo.test.js | 37 +- test/services/mysql.test.js | 37 +- test/services/oauth2.test.js | 16 +- test/services/organization.test.js | 184 +- test/services/postgresql.test.js | 45 +- test/services/project.test.js | 97 +- test/services/sites.test.js | 2 +- test/services/tables-d-b.test.js | 61 +- test/services/users.test.js | 13 - test/services/vectors-d-b.test.js | 5 +- 146 files changed, 12010 insertions(+), 3428 deletions(-) rename docs/examples/account/{list-logs.md => create-email-verification-otp.md} (77%) create mode 100644 docs/examples/account/create-id-token-session.md create mode 100644 docs/examples/account/create-recovery-otp.md create mode 100644 docs/examples/account/update-email-verification-otp.md create mode 100644 docs/examples/account/update-recovery-otp.md create mode 100644 docs/examples/domains/create-preset-google-workspace.md create mode 100644 docs/examples/domains/create-preset-i-cloud.md create mode 100644 docs/examples/domains/create-preset-mailgun.md create mode 100644 docs/examples/domains/create-preset-outlook.md create mode 100644 docs/examples/domains/create-preset-proton-mail.md create mode 100644 docs/examples/domains/create-preset-zoho.md create mode 100644 docs/examples/domains/create-record-a.md create mode 100644 docs/examples/domains/create-record-aaaa.md create mode 100644 docs/examples/domains/create-record-alias.md create mode 100644 docs/examples/domains/create-record-caa.md create mode 100644 docs/examples/domains/create-record-cname.md create mode 100644 docs/examples/domains/create-record-https.md create mode 100644 docs/examples/domains/create-record-mx.md create mode 100644 docs/examples/domains/create-record-ns.md create mode 100644 docs/examples/domains/create-record-srv.md create mode 100644 docs/examples/domains/create-record-txt.md create mode 100644 docs/examples/domains/create.md create mode 100644 docs/examples/domains/delete-record.md create mode 100644 docs/examples/domains/delete.md create mode 100644 docs/examples/domains/get-preset-google-workspace.md create mode 100644 docs/examples/domains/get-preset-i-cloud.md create mode 100644 docs/examples/domains/get-preset-mailgun.md create mode 100644 docs/examples/domains/get-preset-outlook.md create mode 100644 docs/examples/domains/get-preset-proton-mail.md create mode 100644 docs/examples/domains/get-preset-zoho.md create mode 100644 docs/examples/domains/get-price.md create mode 100644 docs/examples/domains/get-record.md create mode 100644 docs/examples/domains/get-transfer-status.md create mode 100644 docs/examples/domains/get-zone.md create mode 100644 docs/examples/domains/get.md create mode 100644 docs/examples/domains/list-prices.md rename docs/examples/{users/list-logs.md => domains/list-records.md} (70%) create mode 100644 docs/examples/domains/list.md create mode 100644 docs/examples/domains/update-nameservers.md create mode 100644 docs/examples/domains/update-record-a.md create mode 100644 docs/examples/domains/update-record-aaaa.md create mode 100644 docs/examples/domains/update-record-alias.md create mode 100644 docs/examples/domains/update-record-caa.md create mode 100644 docs/examples/domains/update-record-cname.md create mode 100644 docs/examples/domains/update-record-https.md create mode 100644 docs/examples/domains/update-record-mx.md create mode 100644 docs/examples/domains/update-record-ns.md create mode 100644 docs/examples/domains/update-record-srv.md create mode 100644 docs/examples/domains/update-record-txt.md create mode 100644 docs/examples/domains/update-team.md create mode 100644 docs/examples/domains/update-zone.md create mode 100644 docs/examples/domains/verify-nameservers.md create mode 100644 docs/examples/messaging/create-appwrite-provider.md create mode 100644 docs/examples/messaging/update-appwrite-provider.md create mode 100644 docs/examples/oauth2/introspect.md rename docs/examples/organization/{create-key.md => create-ephemeral-project-key.md} (62%) rename docs/examples/organization/{get-key.md => delete-project-key.md} (80%) rename docs/examples/organization/{delete-key.md => get-project-key.md} (81%) rename docs/examples/organization/{list-keys.md => list-project-keys.md} (82%) rename docs/examples/organization/{update-key.md => update-project-key.md} (76%) create mode 100644 docs/examples/project/update-o-auth-2-kakao.md create mode 100644 docs/examples/project/update-o-auth-2-tik-tok.md create mode 100644 docs/examples/project/update-password-pwned-policy.md create mode 100644 src/enums/domain-registration-type.ts create mode 100644 src/enums/domain-transfer-status-enum.ts create mode 100644 src/enums/id-token-provider.ts delete mode 100644 src/enums/organization-key-scopes.ts create mode 100644 src/services/domains.ts create mode 100644 test/services/domains.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 658b743c..39677471 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Change Log +## 30.0.0 + +* Breaking: `account.listLogs`, `users.listLogs`, `Log` and `LogList` removed +* Breaking: `organization` key methods renamed to `createEphemeralProjectKey`, `getProjectKey`, `listProjectKeys`, `updateProjectKey`, `deleteProjectKey`, and `OrganizationKeyScopes` removed +* Breaking: `setDevKey` client method, `DevKey` model and `Project.devKeys` removed +* Breaking: `region`, `reason`, `projectName`, `organizationId`, `organizationName`, `billingPlan` removed from `Block` +* Breaking: `DedicatedDatabaseSpecificationList.pricing` and `DedicatedDatabaseSpecificationPricing` removed; rates now live on each `DedicatedDatabaseSpecification` +* Breaking: `BillingPlanGroup.Starter` replaced by `Free` and `Start` +* Added: `oauth2.introspect` for RFC 7662 token introspection with an API key, returning the `Oauth2Introspection` model +* Added: `domains` service for domains, DNS records, email presets, prices and transfers +* Added: `account.createIdTokenSession` and email verification and recovery OTP methods +* Added: `messaging.createAppwriteProvider` and `messaging.updateAppwriteProvider` +* Added: `project.updatePasswordPwnedPolicy` with `PolicyPasswordPwned` model and `User.passwordPwned` +* Added: Kakao and TikTok OAuth2 providers +* Added: native client IDs on the Apple and Google OAuth2 providers +* Added: reply-to on email messages, `qos` and `expiry` on topics +* Added: `ImageGravity.Auto`, `jaspr` framework, and `dart-3.13` and `flutter-3.47` runtimes +* Updated: requests send `X-Appwrite-Response-Format` `2.3.0` + ## 29.0.0 * Stable release of the dedicated database APIs: `mysql`, `postgresql`, `mongo`, `documentsDB`, and `vectorsDB` services, previously released as release candidates diff --git a/README.md b/README.md index 83b7e18d..7f9e1f1b 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite Node.js SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-2.0.0-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-2.3.0-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK targets Appwrite server version 1.9.x as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-node/releases) when APIs differ. +**This SDK targets Appwrite server version latest as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-node/releases) when APIs differ. > This is the Node.js SDK for integrating with Appwrite from your Node.js server-side code. If you're looking to integrate from the browser, you should check [appwrite/sdk-for-web](https://github.com/appwrite/sdk-for-web) diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/create-email-verification-otp.md similarity index 77% rename from docs/examples/account/list-logs.md rename to docs/examples/account/create-email-verification-otp.md index 6d993109..07f28610 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/create-email-verification-otp.md @@ -8,8 +8,7 @@ const client = new sdk.Client() const account = new sdk.Account(client); -const result = await account.listLogs({ - queries: [], // optional - total: false, // optional +const result = await account.createEmailVerificationOTP({ + phrase: false, // optional }); ``` diff --git a/docs/examples/account/create-id-token-session.md b/docs/examples/account/create-id-token-session.md new file mode 100644 index 00000000..39dcb8d3 --- /dev/null +++ b/docs/examples/account/create-id-token-session.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createIdTokenSession({ + provider: sdk.IdTokenProvider.Apple, + idToken: '', + nonce: '', // optional + accessToken: '', // optional + accessTokenExpiry: 0, // optional + name: '', // optional +}); +``` diff --git a/docs/examples/account/create-recovery-otp.md b/docs/examples/account/create-recovery-otp.md new file mode 100644 index 00000000..6c5d5376 --- /dev/null +++ b/docs/examples/account/create-recovery-otp.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createRecoveryOTP({ + email: 'email@example.com', + phrase: false, // optional +}); +``` diff --git a/docs/examples/account/update-email-verification-otp.md b/docs/examples/account/update-email-verification-otp.md new file mode 100644 index 00000000..82c8731b --- /dev/null +++ b/docs/examples/account/update-email-verification-otp.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateEmailVerificationOTP({ + userId: '', + secret: '', +}); +``` diff --git a/docs/examples/account/update-recovery-otp.md b/docs/examples/account/update-recovery-otp.md new file mode 100644 index 00000000..29af5163 --- /dev/null +++ b/docs/examples/account/update-recovery-otp.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateRecoveryOTP({ + userId: '', + secret: '', + password: 'password', +}); +``` diff --git a/docs/examples/domains/create-preset-google-workspace.md b/docs/examples/domains/create-preset-google-workspace.md new file mode 100644 index 00000000..2387d379 --- /dev/null +++ b/docs/examples/domains/create-preset-google-workspace.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.createPresetGoogleWorkspace({ + domainId: '', +}); +``` diff --git a/docs/examples/domains/create-preset-i-cloud.md b/docs/examples/domains/create-preset-i-cloud.md new file mode 100644 index 00000000..33e98837 --- /dev/null +++ b/docs/examples/domains/create-preset-i-cloud.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.createPresetICloud({ + domainId: '', +}); +``` diff --git a/docs/examples/domains/create-preset-mailgun.md b/docs/examples/domains/create-preset-mailgun.md new file mode 100644 index 00000000..3879a871 --- /dev/null +++ b/docs/examples/domains/create-preset-mailgun.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.createPresetMailgun({ + domainId: '', +}); +``` diff --git a/docs/examples/domains/create-preset-outlook.md b/docs/examples/domains/create-preset-outlook.md new file mode 100644 index 00000000..5001f2af --- /dev/null +++ b/docs/examples/domains/create-preset-outlook.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.createPresetOutlook({ + domainId: '', +}); +``` diff --git a/docs/examples/domains/create-preset-proton-mail.md b/docs/examples/domains/create-preset-proton-mail.md new file mode 100644 index 00000000..3e7271cf --- /dev/null +++ b/docs/examples/domains/create-preset-proton-mail.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.createPresetProtonMail({ + domainId: '', +}); +``` diff --git a/docs/examples/domains/create-preset-zoho.md b/docs/examples/domains/create-preset-zoho.md new file mode 100644 index 00000000..d5c3a9d3 --- /dev/null +++ b/docs/examples/domains/create-preset-zoho.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.createPresetZoho({ + domainId: '', +}); +``` diff --git a/docs/examples/domains/create-record-a.md b/docs/examples/domains/create-record-a.md new file mode 100644 index 00000000..79ea1b5a --- /dev/null +++ b/docs/examples/domains/create-record-a.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.createRecordA({ + domainId: '', + name: '', + value: '', + ttl: 1, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/create-record-aaaa.md b/docs/examples/domains/create-record-aaaa.md new file mode 100644 index 00000000..67aac220 --- /dev/null +++ b/docs/examples/domains/create-record-aaaa.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.createRecordAAAA({ + domainId: '', + name: '', + value: '', + ttl: 1, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/create-record-alias.md b/docs/examples/domains/create-record-alias.md new file mode 100644 index 00000000..c1212f81 --- /dev/null +++ b/docs/examples/domains/create-record-alias.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.createRecordAlias({ + domainId: '', + name: '', + value: '', + ttl: 1, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/create-record-caa.md b/docs/examples/domains/create-record-caa.md new file mode 100644 index 00000000..4275ae40 --- /dev/null +++ b/docs/examples/domains/create-record-caa.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.createRecordCAA({ + domainId: '', + name: '', + value: '', + ttl: 1, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/create-record-cname.md b/docs/examples/domains/create-record-cname.md new file mode 100644 index 00000000..6e56f1a4 --- /dev/null +++ b/docs/examples/domains/create-record-cname.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.createRecordCNAME({ + domainId: '', + name: '', + value: '', + ttl: 1, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/create-record-https.md b/docs/examples/domains/create-record-https.md new file mode 100644 index 00000000..6bd9ed88 --- /dev/null +++ b/docs/examples/domains/create-record-https.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.createRecordHTTPS({ + domainId: '', + name: '', + value: '', + ttl: 1, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/create-record-mx.md b/docs/examples/domains/create-record-mx.md new file mode 100644 index 00000000..dd2aabd9 --- /dev/null +++ b/docs/examples/domains/create-record-mx.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.createRecordMX({ + domainId: '', + name: '', + value: '', + ttl: 1, + priority: 0, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/create-record-ns.md b/docs/examples/domains/create-record-ns.md new file mode 100644 index 00000000..33d3c969 --- /dev/null +++ b/docs/examples/domains/create-record-ns.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.createRecordNS({ + domainId: '', + name: '', + value: '', + ttl: 1, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/create-record-srv.md b/docs/examples/domains/create-record-srv.md new file mode 100644 index 00000000..c1868c77 --- /dev/null +++ b/docs/examples/domains/create-record-srv.md @@ -0,0 +1,21 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.createRecordSRV({ + domainId: '', + name: '', + value: '', + ttl: 1, + priority: 0, + weight: 0, + port: 0, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/create-record-txt.md b/docs/examples/domains/create-record-txt.md new file mode 100644 index 00000000..8cd90560 --- /dev/null +++ b/docs/examples/domains/create-record-txt.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.createRecordTXT({ + domainId: '', + name: '', + ttl: 1, + value: '', // optional + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/create.md b/docs/examples/domains/create.md new file mode 100644 index 00000000..1f99aa75 --- /dev/null +++ b/docs/examples/domains/create.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.create({ + teamId: '', + domain: 'example.com', +}); +``` diff --git a/docs/examples/domains/delete-record.md b/docs/examples/domains/delete-record.md new file mode 100644 index 00000000..86244ac3 --- /dev/null +++ b/docs/examples/domains/delete-record.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.deleteRecord({ + domainId: '', + recordId: '', +}); +``` diff --git a/docs/examples/domains/delete.md b/docs/examples/domains/delete.md new file mode 100644 index 00000000..94094fc0 --- /dev/null +++ b/docs/examples/domains/delete.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.delete({ + domainId: '', +}); +``` diff --git a/docs/examples/domains/get-preset-google-workspace.md b/docs/examples/domains/get-preset-google-workspace.md new file mode 100644 index 00000000..c6fc1290 --- /dev/null +++ b/docs/examples/domains/get-preset-google-workspace.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.getPresetGoogleWorkspace({ + domainId: '', +}); +``` diff --git a/docs/examples/domains/get-preset-i-cloud.md b/docs/examples/domains/get-preset-i-cloud.md new file mode 100644 index 00000000..354b5330 --- /dev/null +++ b/docs/examples/domains/get-preset-i-cloud.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.getPresetICloud({ + domainId: '', +}); +``` diff --git a/docs/examples/domains/get-preset-mailgun.md b/docs/examples/domains/get-preset-mailgun.md new file mode 100644 index 00000000..fd12cb67 --- /dev/null +++ b/docs/examples/domains/get-preset-mailgun.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.getPresetMailgun({ + domainId: '', +}); +``` diff --git a/docs/examples/domains/get-preset-outlook.md b/docs/examples/domains/get-preset-outlook.md new file mode 100644 index 00000000..ccfc1f4d --- /dev/null +++ b/docs/examples/domains/get-preset-outlook.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.getPresetOutlook({ + domainId: '', +}); +``` diff --git a/docs/examples/domains/get-preset-proton-mail.md b/docs/examples/domains/get-preset-proton-mail.md new file mode 100644 index 00000000..0861b017 --- /dev/null +++ b/docs/examples/domains/get-preset-proton-mail.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.getPresetProtonMail({ + domainId: '', +}); +``` diff --git a/docs/examples/domains/get-preset-zoho.md b/docs/examples/domains/get-preset-zoho.md new file mode 100644 index 00000000..7e02f27d --- /dev/null +++ b/docs/examples/domains/get-preset-zoho.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.getPresetZoho({ + domainId: '', +}); +``` diff --git a/docs/examples/domains/get-price.md b/docs/examples/domains/get-price.md new file mode 100644 index 00000000..ff776755 --- /dev/null +++ b/docs/examples/domains/get-price.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.getPrice({ + domain: 'example.com', + periodYears: null, // optional + registrationType: sdk.DomainRegistrationType.New, // optional +}); +``` diff --git a/docs/examples/domains/get-record.md b/docs/examples/domains/get-record.md new file mode 100644 index 00000000..79d55e83 --- /dev/null +++ b/docs/examples/domains/get-record.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.getRecord({ + domainId: '', + recordId: '', +}); +``` diff --git a/docs/examples/domains/get-transfer-status.md b/docs/examples/domains/get-transfer-status.md new file mode 100644 index 00000000..288d6b96 --- /dev/null +++ b/docs/examples/domains/get-transfer-status.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.getTransferStatus({ + domainId: '', +}); +``` diff --git a/docs/examples/domains/get-zone.md b/docs/examples/domains/get-zone.md new file mode 100644 index 00000000..f05ee246 --- /dev/null +++ b/docs/examples/domains/get-zone.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.getZone({ + domainId: '', +}); +``` diff --git a/docs/examples/domains/get.md b/docs/examples/domains/get.md new file mode 100644 index 00000000..3b73d8f8 --- /dev/null +++ b/docs/examples/domains/get.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.get({ + domainId: '', +}); +``` diff --git a/docs/examples/domains/list-prices.md b/docs/examples/domains/list-prices.md new file mode 100644 index 00000000..bcf35720 --- /dev/null +++ b/docs/examples/domains/list-prices.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.listPrices({ + domains: [], + periodYears: null, // optional + registrationType: sdk.DomainRegistrationType.New, // optional +}); +``` diff --git a/docs/examples/users/list-logs.md b/docs/examples/domains/list-records.md similarity index 70% rename from docs/examples/users/list-logs.md rename to docs/examples/domains/list-records.md index 9ed271f2..5cbab516 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/domains/list-records.md @@ -6,11 +6,10 @@ const client = new sdk.Client() .setProject('') // Your project ID .setKey(''); // Your secret API key -const users = new sdk.Users(client); +const domains = new sdk.Domains(client); -const result = await users.listLogs({ - userId: '', +const result = await domains.listRecords({ + domainId: '', queries: [], // optional - total: false, // optional }); ``` diff --git a/docs/examples/domains/list.md b/docs/examples/domains/list.md new file mode 100644 index 00000000..8974554f --- /dev/null +++ b/docs/examples/domains/list.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.list({ + queries: [], // optional + search: '', // optional +}); +``` diff --git a/docs/examples/domains/update-nameservers.md b/docs/examples/domains/update-nameservers.md new file mode 100644 index 00000000..0f13aa57 --- /dev/null +++ b/docs/examples/domains/update-nameservers.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.updateNameservers({ + domainId: '', + nameservers: [], // optional +}); +``` diff --git a/docs/examples/domains/update-record-a.md b/docs/examples/domains/update-record-a.md new file mode 100644 index 00000000..b7fe113a --- /dev/null +++ b/docs/examples/domains/update-record-a.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.updateRecordA({ + domainId: '', + recordId: '', + name: '', + value: '', + ttl: 1, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/update-record-aaaa.md b/docs/examples/domains/update-record-aaaa.md new file mode 100644 index 00000000..2fbd89a3 --- /dev/null +++ b/docs/examples/domains/update-record-aaaa.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.updateRecordAAAA({ + domainId: '', + recordId: '', + name: '', + value: '', + ttl: 1, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/update-record-alias.md b/docs/examples/domains/update-record-alias.md new file mode 100644 index 00000000..9ecc5b0c --- /dev/null +++ b/docs/examples/domains/update-record-alias.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.updateRecordAlias({ + domainId: '', + recordId: '', + name: '', + value: '', + ttl: 1, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/update-record-caa.md b/docs/examples/domains/update-record-caa.md new file mode 100644 index 00000000..3c260306 --- /dev/null +++ b/docs/examples/domains/update-record-caa.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.updateRecordCAA({ + domainId: '', + recordId: '', + name: '', + value: '', + ttl: 1, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/update-record-cname.md b/docs/examples/domains/update-record-cname.md new file mode 100644 index 00000000..ba8de6a2 --- /dev/null +++ b/docs/examples/domains/update-record-cname.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.updateRecordCNAME({ + domainId: '', + recordId: '', + name: '', + value: '', + ttl: 1, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/update-record-https.md b/docs/examples/domains/update-record-https.md new file mode 100644 index 00000000..66ce4ac3 --- /dev/null +++ b/docs/examples/domains/update-record-https.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.updateRecordHTTPS({ + domainId: '', + recordId: '', + name: '', + value: '', + ttl: 1, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/update-record-mx.md b/docs/examples/domains/update-record-mx.md new file mode 100644 index 00000000..5d4383ea --- /dev/null +++ b/docs/examples/domains/update-record-mx.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.updateRecordMX({ + domainId: '', + recordId: '', + name: '', + value: '', + ttl: 1, + priority: 0, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/update-record-ns.md b/docs/examples/domains/update-record-ns.md new file mode 100644 index 00000000..3317ce0a --- /dev/null +++ b/docs/examples/domains/update-record-ns.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.updateRecordNS({ + domainId: '', + recordId: '', + name: '', + value: '', + ttl: 1, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/update-record-srv.md b/docs/examples/domains/update-record-srv.md new file mode 100644 index 00000000..d81b1a89 --- /dev/null +++ b/docs/examples/domains/update-record-srv.md @@ -0,0 +1,22 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.updateRecordSRV({ + domainId: '', + recordId: '', + name: '', + value: '', + ttl: 1, + priority: 0, + weight: 0, + port: 0, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/update-record-txt.md b/docs/examples/domains/update-record-txt.md new file mode 100644 index 00000000..8417f85b --- /dev/null +++ b/docs/examples/domains/update-record-txt.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.updateRecordTXT({ + domainId: '', + recordId: '', + name: '', + value: '', + ttl: 1, + comment: '', // optional +}); +``` diff --git a/docs/examples/domains/update-team.md b/docs/examples/domains/update-team.md new file mode 100644 index 00000000..8193b7f4 --- /dev/null +++ b/docs/examples/domains/update-team.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.updateTeam({ + domainId: '', + teamId: '', +}); +``` diff --git a/docs/examples/domains/update-zone.md b/docs/examples/domains/update-zone.md new file mode 100644 index 00000000..e146266a --- /dev/null +++ b/docs/examples/domains/update-zone.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.updateZone({ + domainId: '', + content: '', +}); +``` diff --git a/docs/examples/domains/verify-nameservers.md b/docs/examples/domains/verify-nameservers.md new file mode 100644 index 00000000..d6cd0e2c --- /dev/null +++ b/docs/examples/domains/verify-nameservers.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const domains = new sdk.Domains(client); + +const result = await domains.verifyNameservers({ + domainId: '', +}); +``` diff --git a/docs/examples/messaging/create-appwrite-provider.md b/docs/examples/messaging/create-appwrite-provider.md new file mode 100644 index 00000000..0ad3b75d --- /dev/null +++ b/docs/examples/messaging/create-appwrite-provider.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.createAppwriteProvider({ + providerId: '', + name: '', + enabled: false, // optional + qos: 0, // optional + expiry: 0, // optional +}); +``` diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index c979b47c..499e3928 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -18,6 +18,8 @@ const result = await messaging.createEmail({ cc: [], // optional bcc: [], // optional attachments: [], // optional + replyToEmail: 'email@example.com', // optional + replyToName: '', // optional draft: false, // optional html: false, // optional scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 5a05064e..0a4b2926 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -12,5 +12,7 @@ const result = await messaging.createTopic({ topicId: '', name: '', subscribe: ['any'], // optional + qos: 0, // optional + expiry: 0, // optional }); ``` diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index 4b25a767..ae0b6fd4 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -11,7 +11,7 @@ const messaging = new sdk.Messaging(client); const result = await messaging.createTwilioProvider({ providerId: '', name: '', - from: '+12065550100', // optional + from: '', // optional accountSid: '', // optional authToken: '', // optional enabled: false, // optional diff --git a/docs/examples/messaging/update-appwrite-provider.md b/docs/examples/messaging/update-appwrite-provider.md new file mode 100644 index 00000000..b41d18f0 --- /dev/null +++ b/docs/examples/messaging/update-appwrite-provider.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const result = await messaging.updateAppwriteProvider({ + providerId: '', + name: '', // optional + enabled: false, // optional + qos: 0, // optional + expiry: 0, // optional +}); +``` diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index aaf9d751..426641c7 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -19,6 +19,8 @@ const result = await messaging.updateEmail({ html: false, // optional cc: [], // optional bcc: [], // optional + replyToEmail: 'email@example.com', // optional + replyToName: '', // optional scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional attachments: [], // optional }); diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 2397220a..292b3b6a 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -12,5 +12,7 @@ const result = await messaging.updateTopic({ topicId: '', name: '', // optional subscribe: ['any'], // optional + qos: 0, // optional + expiry: 0, // optional }); ``` diff --git a/docs/examples/oauth2/approve.md b/docs/examples/oauth2/approve.md index 06ee2a8d..ee122266 100644 --- a/docs/examples/oauth2/approve.md +++ b/docs/examples/oauth2/approve.md @@ -3,8 +3,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const oauth2 = new sdk.Oauth2(client); diff --git a/docs/examples/oauth2/authorize-post.md b/docs/examples/oauth2/authorize-post.md index ca9cc0a0..003c7179 100644 --- a/docs/examples/oauth2/authorize-post.md +++ b/docs/examples/oauth2/authorize-post.md @@ -3,8 +3,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const oauth2 = new sdk.Oauth2(client); diff --git a/docs/examples/oauth2/authorize.md b/docs/examples/oauth2/authorize.md index 38047d72..fe529c62 100644 --- a/docs/examples/oauth2/authorize.md +++ b/docs/examples/oauth2/authorize.md @@ -3,8 +3,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const oauth2 = new sdk.Oauth2(client); diff --git a/docs/examples/oauth2/create-device-authorization.md b/docs/examples/oauth2/create-device-authorization.md index d9e2d61d..e49bef1d 100644 --- a/docs/examples/oauth2/create-device-authorization.md +++ b/docs/examples/oauth2/create-device-authorization.md @@ -3,8 +3,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const oauth2 = new sdk.Oauth2(client); diff --git a/docs/examples/oauth2/create-grant.md b/docs/examples/oauth2/create-grant.md index 198af628..e0989fb2 100644 --- a/docs/examples/oauth2/create-grant.md +++ b/docs/examples/oauth2/create-grant.md @@ -3,8 +3,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const oauth2 = new sdk.Oauth2(client); diff --git a/docs/examples/oauth2/create-par.md b/docs/examples/oauth2/create-par.md index f9febbaa..b579484e 100644 --- a/docs/examples/oauth2/create-par.md +++ b/docs/examples/oauth2/create-par.md @@ -3,8 +3,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const oauth2 = new sdk.Oauth2(client); diff --git a/docs/examples/oauth2/create-token.md b/docs/examples/oauth2/create-token.md index a45fa1b7..ea081d15 100644 --- a/docs/examples/oauth2/create-token.md +++ b/docs/examples/oauth2/create-token.md @@ -3,8 +3,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const oauth2 = new sdk.Oauth2(client); diff --git a/docs/examples/oauth2/get-grant.md b/docs/examples/oauth2/get-grant.md index dcd21cee..59c8a565 100644 --- a/docs/examples/oauth2/get-grant.md +++ b/docs/examples/oauth2/get-grant.md @@ -3,8 +3,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const oauth2 = new sdk.Oauth2(client); diff --git a/docs/examples/oauth2/introspect.md b/docs/examples/oauth2/introspect.md new file mode 100644 index 00000000..5845699b --- /dev/null +++ b/docs/examples/oauth2/introspect.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const oauth2 = new sdk.Oauth2(client); + +const result = await oauth2.introspect({ + token: '', + tokenTypeHint: 'access_token', // optional + clientId: '', // optional + clientSecret: '', // optional +}); +``` diff --git a/docs/examples/oauth2/list-organizations.md b/docs/examples/oauth2/list-organizations.md index ddf5793f..ca8121cf 100644 --- a/docs/examples/oauth2/list-organizations.md +++ b/docs/examples/oauth2/list-organizations.md @@ -3,8 +3,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const oauth2 = new sdk.Oauth2(client); diff --git a/docs/examples/oauth2/list-projects.md b/docs/examples/oauth2/list-projects.md index 2a5acae7..6b2488ca 100644 --- a/docs/examples/oauth2/list-projects.md +++ b/docs/examples/oauth2/list-projects.md @@ -3,8 +3,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const oauth2 = new sdk.Oauth2(client); diff --git a/docs/examples/oauth2/reject.md b/docs/examples/oauth2/reject.md index a577dab0..473305b5 100644 --- a/docs/examples/oauth2/reject.md +++ b/docs/examples/oauth2/reject.md @@ -3,8 +3,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const oauth2 = new sdk.Oauth2(client); diff --git a/docs/examples/oauth2/revoke.md b/docs/examples/oauth2/revoke.md index 287d65f2..b2c9a5de 100644 --- a/docs/examples/oauth2/revoke.md +++ b/docs/examples/oauth2/revoke.md @@ -3,8 +3,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setSession('') // The user session to authenticate with - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const oauth2 = new sdk.Oauth2(client); diff --git a/docs/examples/organization/create-key.md b/docs/examples/organization/create-ephemeral-project-key.md similarity index 62% rename from docs/examples/organization/create-key.md rename to docs/examples/organization/create-ephemeral-project-key.md index c4183dc4..a2801e67 100644 --- a/docs/examples/organization/create-key.md +++ b/docs/examples/organization/create-ephemeral-project-key.md @@ -8,10 +8,9 @@ const client = new sdk.Client() const organization = new sdk.Organization(client); -const result = await organization.createKey({ - keyId: '', - name: '', - scopes: [sdk.OrganizationKeyScopes.ProjectsRead], - expire: '2020-10-15T06:38:00.000+00:00', // optional +const result = await organization.createEphemeralProjectKey({ + projectId: '', + scopes: [sdk.ProjectKeyScopes.ProjectRead], + duration: 600, }); ``` diff --git a/docs/examples/organization/get-key.md b/docs/examples/organization/delete-project-key.md similarity index 80% rename from docs/examples/organization/get-key.md rename to docs/examples/organization/delete-project-key.md index 84551aee..1e6db3c7 100644 --- a/docs/examples/organization/get-key.md +++ b/docs/examples/organization/delete-project-key.md @@ -8,7 +8,8 @@ const client = new sdk.Client() const organization = new sdk.Organization(client); -const result = await organization.getKey({ +const result = await organization.deleteProjectKey({ + projectId: '', keyId: '', }); ``` diff --git a/docs/examples/organization/delete-key.md b/docs/examples/organization/get-project-key.md similarity index 81% rename from docs/examples/organization/delete-key.md rename to docs/examples/organization/get-project-key.md index 5cdd4e02..23171a6a 100644 --- a/docs/examples/organization/delete-key.md +++ b/docs/examples/organization/get-project-key.md @@ -8,7 +8,8 @@ const client = new sdk.Client() const organization = new sdk.Organization(client); -const result = await organization.deleteKey({ +const result = await organization.getProjectKey({ + projectId: '', keyId: '', }); ``` diff --git a/docs/examples/organization/list-keys.md b/docs/examples/organization/list-project-keys.md similarity index 82% rename from docs/examples/organization/list-keys.md rename to docs/examples/organization/list-project-keys.md index d6765709..74487441 100644 --- a/docs/examples/organization/list-keys.md +++ b/docs/examples/organization/list-project-keys.md @@ -8,7 +8,8 @@ const client = new sdk.Client() const organization = new sdk.Organization(client); -const result = await organization.listKeys({ +const result = await organization.listProjectKeys({ + projectId: '', queries: [], // optional total: false, // optional }); diff --git a/docs/examples/organization/update-key.md b/docs/examples/organization/update-project-key.md similarity index 76% rename from docs/examples/organization/update-key.md rename to docs/examples/organization/update-project-key.md index cca30fd1..17d19c4f 100644 --- a/docs/examples/organization/update-key.md +++ b/docs/examples/organization/update-project-key.md @@ -8,10 +8,11 @@ const client = new sdk.Client() const organization = new sdk.Organization(client); -const result = await organization.updateKey({ +const result = await organization.updateProjectKey({ + projectId: '', keyId: '', name: '', - scopes: [sdk.OrganizationKeyScopes.ProjectsRead], + scopes: [sdk.ProjectKeyScopes.ProjectRead], expire: '2020-10-15T06:38:00.000+00:00', // optional }); ``` diff --git a/docs/examples/project/update-o-auth-2-apple.md b/docs/examples/project/update-o-auth-2-apple.md index 7c6f5590..9319a90e 100644 --- a/docs/examples/project/update-o-auth-2-apple.md +++ b/docs/examples/project/update-o-auth-2-apple.md @@ -13,6 +13,8 @@ const result = await project.updateOAuth2Apple({ keyId: '', // optional teamId: '', // optional p8File: '', // optional + nativeClientIds: [], // optional enabled: false, // optional + nativeEnabled: false, // optional }); ``` diff --git a/docs/examples/project/update-o-auth-2-google.md b/docs/examples/project/update-o-auth-2-google.md index 17696bf7..0325eefa 100644 --- a/docs/examples/project/update-o-auth-2-google.md +++ b/docs/examples/project/update-o-auth-2-google.md @@ -12,6 +12,8 @@ const result = await project.updateOAuth2Google({ clientId: '', // optional clientSecret: '', // optional prompt: [sdk.ProjectOAuth2GooglePrompt.None], // optional + nativeClientIds: [], // optional enabled: false, // optional + nativeEnabled: false, // optional }); ``` diff --git a/docs/examples/project/update-o-auth-2-kakao.md b/docs/examples/project/update-o-auth-2-kakao.md new file mode 100644 index 00000000..1a26ea6a --- /dev/null +++ b/docs/examples/project/update-o-auth-2-kakao.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2Kakao({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false, // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-tik-tok.md b/docs/examples/project/update-o-auth-2-tik-tok.md new file mode 100644 index 00000000..dd7d2e8d --- /dev/null +++ b/docs/examples/project/update-o-auth-2-tik-tok.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateOAuth2TikTok({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false, // optional +}); +``` diff --git a/docs/examples/project/update-password-pwned-policy.md b/docs/examples/project/update-password-pwned-policy.md new file mode 100644 index 00000000..df89b350 --- /dev/null +++ b/docs/examples/project/update-password-pwned-policy.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updatePasswordPwnedPolicy({ + enabled: false, // optional + sessions: false, // optional + users: false, // optional +}); +``` diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 5e13a0ba..d3447ea2 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -13,7 +13,7 @@ const result = await storage.getFilePreview({ fileId: '', width: 0, // optional height: 0, // optional - gravity: sdk.ImageGravity.Center, // optional + gravity: sdk.ImageGravity.Auto, // optional quality: -1, // optional borderWidth: 0, // optional borderColor: 'FFFFFF', // optional diff --git a/package-lock.json b/package-lock.json index 6c386f65..6ff18e85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "node-appwrite", - "version": "29.0.0", + "version": "30.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-appwrite", - "version": "29.0.0", + "version": "30.0.0", "license": "BSD-3-Clause", "dependencies": { "json-bigint": "1.0.0", @@ -15,16 +15,16 @@ "devDependencies": { "@eslint/js": "10.0.1", "@types/json-bigint": "1.0.4", - "@types/node": "26.2.0", + "@types/node": "26.5.1", "esbuild-plugin-file-path-extensions": "^2.0.0", - "eslint": "10.9.0", + "eslint": "10.10.0", "globals": "16.5.0", "jest": "^30.4.2", "prettier": "3.9.6", "tslib": "2.8.1", "tsup": "^8.5.1", "typescript": "5.9.3", - "typescript-eslint": "8.67.0" + "typescript-eslint": "8.70.0" }, "overrides": { "esbuild": "^0.28.1", @@ -528,6 +528,30 @@ "dev": true, "license": "MIT" }, + "node_modules/@cacheable/memory": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@cacheable/memory/-/memory-2.2.0.tgz", + "integrity": "sha512-CTLKqLItRCEixEAewD3/j9DB3/o96gpTPD4eJ1v+DGOlxZRZncRQkGYqqnAGCscYd6RNeXfGeiuCphsPtqyIfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cacheable/utils": "^2.5.0", + "@keyv/bigmap": "^1.3.1", + "hookified": "^1.15.1", + "keyv": "^5.6.0" + } + }, + "node_modules/@cacheable/utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@cacheable/utils/-/utils-2.5.0.tgz", + "integrity": "sha512-buipgOVDkkPXNR5+xBpDw7Zk2n1EvU7qBJCNUcL7rhQ//kfpOXPAvQ511Os0vpLYJ1pZnvudNytkQt2hst3wqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hashery": "^1.5.1", + "keyv": "^5.6.0" + } + }, "node_modules/@emnapi/core": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", @@ -1119,9 +1143,9 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.2.tgz", - "integrity": "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==", + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.3.tgz", + "integrity": "sha512-IkO+/KEUvwbVpiURZg+P7zF74z5Jxe0UgJxVni+RtoHQ6IZieXaO02kmadomap/q+l6bc/jdPGGqTjhuZnuz1Q==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -1216,6 +1240,91 @@ "node": ">=12" } }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.3.0.tgz", + "integrity": "sha512-WpDfL7NO6j7tH88IDBNVdUJxDh9nmCteAVW9dsep846XdwF4naCBK+/tGLX3KJgcpgMRXCFlTM2hKGoK9FsdrQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1300,17 +1409,17 @@ } }, "node_modules/@jest/console": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.4.1.tgz", - "integrity": "sha512-v3bhyxUh9Hgmo5p6hAOXe14/R3ZxZDOsvHleh4B07z3m/x4/ngPUXEm9XwK4sF4u+f+P2ORb0Ge+MgpaqRMVDA==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.5.1.tgz", + "integrity": "sha512-u5Ncuc+gXVUwjNMFQOnphHo2Qx2DxyC8Dvpmf4HCx4y0kvSkRRNiQYRixrvOP4V7y52JcSuNxqochCt0PpdHVg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.4.1", + "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", - "jest-message-util": "30.4.1", - "jest-util": "30.4.1", + "jest-message-util": "30.5.1", + "jest-util": "30.5.1", "slash": "^3.0.0" }, "engines": { @@ -1318,18 +1427,18 @@ } }, "node_modules/@jest/core": { - "version": "30.4.2", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.4.2.tgz", - "integrity": "sha512-TZJA6cPJUFxoWhxaLo8t0VX/MZX2wPWr0uIDvLSHIvN4gu9h02vSzqI2kBADG1ExqQlC+cY09xKMSreivvrChQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.5.1.tgz", + "integrity": "sha512-BL9g6CJUUhIbdoAflz/Va658erSSXUIvU8XUYiWNTbZljJjZ5yaC9EJ9/dQ19rpbYV3ZOK4sBACqhPaTyhoUIA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "30.4.1", - "@jest/pattern": "30.4.0", - "@jest/reporters": "30.4.1", - "@jest/test-result": "30.4.1", - "@jest/transform": "30.4.1", - "@jest/types": "30.4.1", + "@jest/console": "30.5.1", + "@jest/pattern": "30.5.0", + "@jest/reporters": "30.5.1", + "@jest/test-result": "30.5.1", + "@jest/transform": "30.5.1", + "@jest/types": "30.5.1", "@types/node": "*", "ansi-escapes": "^4.3.2", "chalk": "^4.1.2", @@ -1337,20 +1446,20 @@ "exit-x": "^0.2.2", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.11", - "jest-changed-files": "30.4.1", - "jest-config": "30.4.2", - "jest-haste-map": "30.4.1", - "jest-message-util": "30.4.1", - "jest-regex-util": "30.4.0", - "jest-resolve": "30.4.1", - "jest-resolve-dependencies": "30.4.2", - "jest-runner": "30.4.2", - "jest-runtime": "30.4.2", - "jest-snapshot": "30.4.1", - "jest-util": "30.4.1", - "jest-validate": "30.4.1", - "jest-watcher": "30.4.1", - "pretty-format": "30.4.1", + "jest-changed-files": "30.5.1", + "jest-config": "30.5.1", + "jest-haste-map": "30.5.1", + "jest-message-util": "30.5.1", + "jest-regex-util": "30.5.0", + "jest-resolve": "30.5.1", + "jest-resolve-dependencies": "30.5.1", + "jest-runner": "30.5.1", + "jest-runtime": "30.5.1", + "jest-snapshot": "30.5.1", + "jest-util": "30.5.1", + "jest-validate": "30.5.1", + "jest-watcher": "30.5.1", + "pretty-format": "30.5.1", "slash": "^3.0.0" }, "engines": { @@ -1366,9 +1475,9 @@ } }, "node_modules/@jest/diff-sequences": { - "version": "30.4.0", - "resolved": "https://registry.npmjs.org/@jest/diff-sequences/-/diff-sequences-30.4.0.tgz", - "integrity": "sha512-zOpzlfUs45l6u7jm39qr87JCHUDsaeCtvL+kQe/Vn9jSnRB4/5IPXISm0h9I1vZW/o00Kn4UTJ2MOlhnUGwv3g==", + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/@jest/diff-sequences/-/diff-sequences-30.5.0.tgz", + "integrity": "sha512-OsqBjHXCn8cadasoAZBP6nWYvMsRhpMzGXTpxJ5aO04NlbdhIz+FVe3q49l0AwVhsz/cEmIpBes6gAFl1/dWQg==", "dev": true, "license": "MIT", "engines": { @@ -1376,70 +1485,70 @@ } }, "node_modules/@jest/environment": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.4.1.tgz", - "integrity": "sha512-AK9yNRqgKxiabqMoe4oW+3/TSSeV8vkdC7BGaxZdU0AFXfOpofTLqdru2GXKZghP3sdgwE9XXpnVwfZ8JnFV4w==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.5.1.tgz", + "integrity": "sha512-eYJAkOsrpwDXPcoLNEG6lN9Zo3Cy35pxnVQD74vyIfsi/Q8wB/lZFsEjU4wrecOgT4ZviQDZaX/cFIJyMdMxTw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/fake-timers": "30.4.1", - "@jest/types": "30.4.1", + "@jest/fake-timers": "30.5.1", + "@jest/types": "30.5.1", "@types/node": "*", - "jest-mock": "30.4.1" + "jest-mock": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/expect": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.4.1.tgz", - "integrity": "sha512-ginrj6TMgh2GshLUGCjO94Ptx9HhdZA/I6A9iUfyeLKFtdAjnKzHDgzgP9HYQgbxM1lbXScQ2eUBz2lGeVDPWA==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.5.1.tgz", + "integrity": "sha512-uOGd40P/COyUp9xHf5jeGiGJC2/ANg+2+Tk9/xN5/LxmlY/r/gxsPrx3DTEtaRZsLAX4wgNSLEDELZ5bmVs2bA==", "dev": true, "license": "MIT", "dependencies": { - "expect": "30.4.1", - "jest-snapshot": "30.4.1" + "expect": "30.5.1", + "jest-snapshot": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/expect-utils": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.4.1.tgz", - "integrity": "sha512-ZBn5CglH8fBsQsvs4VWNzD4aWfUYks+IdOOQU3MEK71ol/BcVm+P+rtb1KpiFBpSWSCE27uOahyyf1vfqOVbcQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.5.1.tgz", + "integrity": "sha512-WcRWhHQdTMRDpyWKZ/6MINBmovI7zeD+bL8wFjCncRV3NQOwKy1X45IfyblfHR4k/XciIlNEdFL9QjFO+HNKOg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/get-type": "30.1.0" + "@jest/get-type": "30.5.0" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/fake-timers": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.4.1.tgz", - "integrity": "sha512-iW5umdmfPeWzehrVhugFQZqCchSCud5S1l2YT0O9ZhjRR0ExclANDZkiSBwzqtnlOn0J1JXvO+HZ6rkuyOVOgQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.5.1.tgz", + "integrity": "sha512-rEkV6YzpBXo/L9cnj2ibyuYZuyGiNWaPUsyCu3HYJbqCV4jnEiKmf7hId20z8eKjZ0JQ9jtIYKxRSmYB/OYSsA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.4.1", + "@jest/types": "30.5.1", "@sinonjs/fake-timers": "^15.4.0", "@types/node": "*", - "jest-message-util": "30.4.1", - "jest-mock": "30.4.1", - "jest-util": "30.4.1" + "jest-message-util": "30.5.1", + "jest-mock": "30.5.1", + "jest-util": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/get-type": { - "version": "30.1.0", - "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.1.0.tgz", - "integrity": "sha512-eMbZE2hUnx1WV0pmURZY9XoXPkUYjpc55mb0CrhtdWLtzMQPFvu/rZkTLZFTsdaVQa+Tr4eWAteqcUzoawq/uA==", + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.5.0.tgz", + "integrity": "sha512-9/2VUPitAjmBzbvDvqrxmvB7BzWsBW0WmkkojX1ODuxX1NLGxx9gfaZpHB0z8DtJ9uhGNmZG/VXBhf8uO0OV8Q==", "dev": true, "license": "MIT", "engines": { @@ -1447,62 +1556,78 @@ } }, "node_modules/@jest/globals": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.4.1.tgz", - "integrity": "sha512-ZbuY4cmXC8DkxYjfvT2DbcHWL2T6vmsMhXCDcmTB2T0y0gaezBI77ufq5ZAIdcRkYZ7NEQEDg1xFeKbxUJ5v5Q==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.5.1.tgz", + "integrity": "sha512-VhqvQ251XIC7pk46YymI3HCeBLOdvriDw9zibekodAHEwoVvbVVgpU5H13GvmyOAzxtZCfsm1uvzqkaqJf2I+g==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "30.4.1", - "@jest/expect": "30.4.1", - "@jest/types": "30.4.1", - "jest-mock": "30.4.1" + "@jest/environment": "30.5.1", + "@jest/expect": "30.5.1", + "@jest/types": "30.5.1", + "jest-mock": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/pattern": { - "version": "30.4.0", - "resolved": "https://registry.npmjs.org/@jest/pattern/-/pattern-30.4.0.tgz", - "integrity": "sha512-RAWn3+f9u8BsHijKJ71uHcFp6vmyEt6VvoWXkl6hKF3qVIuWNmudVjg12DlBPGup/frIl5UcUlH5HfEuvHpEXg==", + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/@jest/pattern/-/pattern-30.5.0.tgz", + "integrity": "sha512-HdNQYSdRTEBNrginaqzQtTjG0HRMfrra/z6Ok7uL3S87vSlarIVohEsJsSj5edu3MiHoHjAkvPROz5ZjoKai+w==", "dev": true, "license": "MIT", "dependencies": { "@types/node": "*", - "jest-regex-util": "30.4.0" + "jest-regex-util": "30.5.0" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, + "node_modules/@jest/react-is-18": { + "name": "react-is", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jest/react-is-19": { + "name": "react-is", + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.3.0.tgz", + "integrity": "sha512-UpMYezM4v5/18F28aC66AEsjXIgE02kyEMH6yLdgLXu/UTfa1Ntwck/nNLrbqJsEXW7gPb0coNO9FQse9WTovA==", + "dev": true, + "license": "MIT" + }, "node_modules/@jest/reporters": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.4.1.tgz", - "integrity": "sha512-/SnkPCzEQpUaBH81kjdEdDdo2WZl5hxw+BmLDGWjRkm8o7XlhjwsU36cqwe5PGBE5WYpBvDzRSdXx9rbGuJtNA==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.5.1.tgz", + "integrity": "sha512-RbUXIfv85KxitJn4l3MpAoMilkvXe2QCO5lXxHWftywo/VdZ5vkEoHRDgphcxP6qmoIkUaN8/UZj6NhdkIFdJg==", "dev": true, "license": "MIT", "dependencies": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "30.4.1", - "@jest/test-result": "30.4.1", - "@jest/transform": "30.4.1", - "@jest/types": "30.4.1", - "@jridgewell/trace-mapping": "^0.3.25", + "@jest/console": "30.5.1", + "@jest/test-result": "30.5.1", + "@jest/transform": "30.5.1", + "@jest/types": "30.5.1", + "@jridgewell/trace-mapping": "^0.3.31", "@types/node": "*", "chalk": "^4.1.2", "collect-v8-coverage": "^1.0.2", "exit-x": "^0.2.2", - "glob": "^10.5.0", + "glob": "^13.0.6", "graceful-fs": "^4.2.11", "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-instrument": "^6.0.0", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^5.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "30.4.1", - "jest-util": "30.4.1", - "jest-worker": "30.4.1", + "jest-message-util": "30.5.1", + "jest-util": "30.5.1", + "jest-worker": "30.5.1", "slash": "^3.0.0", "string-length": "^4.0.2", "v8-to-istanbul": "^9.0.1" @@ -1520,9 +1645,9 @@ } }, "node_modules/@jest/schemas": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.4.1.tgz", - "integrity": "sha512-i6b4qw5qnP8c5FEeBJg/uZQ4ddrkN6Ca8qISJh0pr7a5hfn3h3v5x60BEbOC7OYAGZNMs1LfFLwnW2CuK8F57Q==", + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.5.0.tgz", + "integrity": "sha512-/hunigyNpc4RCjC0VaW3f5RCUZVM2+WQ65qP7z083Gmvac7or2LI50XVNOtE4YPgBpV0yxYiAgorAPGniCoJmg==", "dev": true, "license": "MIT", "dependencies": { @@ -1533,13 +1658,13 @@ } }, "node_modules/@jest/snapshot-utils": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/@jest/snapshot-utils/-/snapshot-utils-30.4.1.tgz", - "integrity": "sha512-ObY4ljvQ95mt6iwKtVLetR/4yXiAgl3H4nJxhztr0MTjrN97TwDYrnCp/kF60Ec9HdhkWTHSu+Hg05aXfngpOA==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/snapshot-utils/-/snapshot-utils-30.5.1.tgz", + "integrity": "sha512-V3wnxNtiVmw5PPVg433Cn3VdXnsOeu/ofLw3KC04Bn2y1wIlU5kozXQn48rhrgj/02LrCVtntTEF1yBha0XSUw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.4.1", + "@jest/types": "30.5.1", "chalk": "^4.1.2", "graceful-fs": "^4.2.11", "natural-compare": "^1.4.0" @@ -1549,14 +1674,15 @@ } }, "node_modules/@jest/source-map": { - "version": "30.0.1", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-30.0.1.tgz", - "integrity": "sha512-MIRWMUUR3sdbP36oyNyhbThLHyJ2eEDClPCiHVbrYAe5g3CHRArIVpBw7cdSB5fr+ofSfIb2Tnsw8iEHL0PYQg==", + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-30.5.0.tgz", + "integrity": "sha512-xWpTJP9D0bDFGbPGT8XuWSwwha/iHADyyKzUnMx4UbdgnHugxrDaQFO4RZ8x4ZsFzRP6pNii8uvlgKCDxCIuDg==", "dev": true, "license": "MIT", "dependencies": { - "@jridgewell/trace-mapping": "^0.3.25", + "@jridgewell/trace-mapping": "^0.3.31", "callsites": "^3.1.0", + "convert-source-map": "^2.0.0", "graceful-fs": "^4.2.11" }, "engines": { @@ -1564,14 +1690,14 @@ } }, "node_modules/@jest/test-result": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.4.1.tgz", - "integrity": "sha512-/ZG7pgEiOmmWkN9TplKbOu4id2N5lh7FHwRwlkgBVAzGdRH+OkkQ8wX/kIxg4zmd3ZQvAL1RwL2yWsvNYYECTw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.5.1.tgz", + "integrity": "sha512-A/1S6ZBdpic50E0pxLgvaB9XNPL4k7AksmG69OO2oiotxciWZwHkbOec+qbIi+uUtIIByOVlXJUl97oZUsz+Jw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "30.4.1", - "@jest/types": "30.4.1", + "@jest/console": "30.5.1", + "@jest/types": "30.5.1", "@types/istanbul-lib-coverage": "^2.0.6", "collect-v8-coverage": "^1.0.2" }, @@ -1580,15 +1706,15 @@ } }, "node_modules/@jest/test-sequencer": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.4.1.tgz", - "integrity": "sha512-PeYE+4td5rKjoRPxztObrXU+H8hsjZfxKMXOcmrr34JerSyB/ROOxbbicz8B7A5j9R9VayDnVPvBmedqCsFCdw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.5.1.tgz", + "integrity": "sha512-SHcPnrjdVRYJv6y6l4JUTy4Jccu7zmO6BmiOfOA34UiVBto22s19WiDC0A/2qfM7MWB/qdcoqfSIRMitpjTT4A==", "dev": true, "license": "MIT", "dependencies": { - "@jest/test-result": "30.4.1", + "@jest/test-result": "30.5.1", "graceful-fs": "^4.2.11", - "jest-haste-map": "30.4.1", + "jest-haste-map": "30.5.1", "slash": "^3.0.0" }, "engines": { @@ -1596,23 +1722,23 @@ } }, "node_modules/@jest/transform": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.4.1.tgz", - "integrity": "sha512-Wz0LyktlTvRefoymh+n64hQ84KNXsRGcwdoZ8CSa0Ea+fgYcHZlnk+hDP7v2MS7il2bQ5uTEIxf4/NNfhMN4KQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.5.1.tgz", + "integrity": "sha512-EDnDhn0jleU9ZhpVoA4gvqw+Ev0iw/r5upNT2b79RiwiaTiYAMMhvNJP3lmocjIe5J2ZkoNr0B3K/J6O5GIm4Q==", "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.27.4", - "@jest/types": "30.4.1", - "@jridgewell/trace-mapping": "^0.3.25", - "babel-plugin-istanbul": "^7.0.1", + "@jest/types": "30.5.1", + "@jridgewell/trace-mapping": "^0.3.31", + "babel-plugin-istanbul": "^8.0.0", "chalk": "^4.1.2", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.11", - "jest-haste-map": "30.4.1", - "jest-regex-util": "30.4.0", - "jest-util": "30.4.1", + "jest-haste-map": "30.5.1", + "jest-regex-util": "30.5.0", + "jest-util": "30.5.1", "pirates": "^4.0.7", "slash": "^3.0.0", "write-file-atomic": "^5.0.1" @@ -1622,14 +1748,14 @@ } }, "node_modules/@jest/types": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.4.1.tgz", - "integrity": "sha512-f1x/vJXIfjOlEmejYpbkbgw1gOqpPECwMvMEtBqe47j7H2Hg8h8w3o3ikhSXq3MI15kg+oQ0exWO0uCtTNJLoQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.5.1.tgz", + "integrity": "sha512-LvVYn83nnXPl+Rg98nvcFgjx6nRMTArhSn6RAX/w3ELn54S8A42TYZvsCMdGUqTM8S0wyXbtlQdU6Hi6dykj9g==", "dev": true, "license": "MIT", "dependencies": { - "@jest/pattern": "30.4.0", - "@jest/schemas": "30.4.1", + "@jest/pattern": "30.5.0", + "@jest/schemas": "30.5.0", "@types/istanbul-lib-coverage": "^2.0.6", "@types/istanbul-reports": "^3.0.4", "@types/node": "*", @@ -1673,9 +1799,9 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", "dev": true, "license": "MIT" }, @@ -1690,6 +1816,30 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@keyv/bigmap": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@keyv/bigmap/-/bigmap-1.3.1.tgz", + "integrity": "sha512-WbzE9sdmQtKy8vrNPa9BRnwZh5UF4s1KTmSK0KUVLo3eff5BlQNNWDnFOouNpKfPKDnms9xynJjsMYjMaT/aFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "hashery": "^1.4.0", + "hookified": "^1.15.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "keyv": "^5.6.0" + } + }, + "node_modules/@keyv/serialize": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@keyv/serialize/-/serialize-1.1.1.tgz", + "integrity": "sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==", + "dev": true, + "license": "MIT" + }, "node_modules/@napi-rs/lzma-linux-x64-gnu": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", @@ -1698,6 +1848,9 @@ "x64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1708,9 +1861,9 @@ } }, "node_modules/@napi-rs/wasm-runtime": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.3.tgz", - "integrity": "sha512-UMduMbqO5s5zF2NkNacMT/yK5Y5QiKvWr2+50bzIIxFDwVJ2h49b+oyjaCGPhJxd2/gC2x39EHv/gHVuu36x2Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.4.tgz", + "integrity": "sha512-AJxoUD2/15ESHbvpcyjU274nsAPLuOtPHCk0vKJM5pj//Fg/B1FXNWjPnXTT9PymCYYiHo4zPj0ZomXBKhoy7g==", "dev": true, "license": "MIT", "optional": true, @@ -1729,48 +1882,45 @@ "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.4" } }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/@pkgr/core": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.3.6.tgz", - "integrity": "sha512-SEeaJLb3qBNF/OaXnaR1NmmBbFYk1zC0ZH/52fATcRPLFg/p791YrcyFFy44Bo9sLaGuSuLp5Q6axbb/O+v/RA==", + "node_modules/@parcel/watcher": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.6.0.tgz", + "integrity": "sha512-7FNeNl8NCE7aINx7WXiKQrPYZWC/hvrTsmk6zmxbI7LTXE7hVek/n8AfVgpe2y82zl3w0HvCHN0bVKMBoJcC0w==", "dev": true, + "hasInstallScript": true, "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.3", + "is-glob": "^4.0.3", + "node-addon-api": "^7.0.0", + "picomatch": "^4.0.4" + }, "engines": { - "node": "^14.18.0 || >=16.0.0" + "node": ">= 10.0.0" }, "funding": { - "url": "https://opencollective.com/pkgr" - } - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.5.tgz", - "integrity": "sha512-jfkGfTwhQpsiSckPF8r9bU3pn3vyd72NlWaO+TgEO6WPSDnUhXzrNYCHBMOYj0ACaUgjm6eERLF+XV9a6RstoA==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.5.tgz", - "integrity": "sha512-oGVqyQlxnrz9/ty89oHpU857VUHEl5/Xu4R2lS+aivCTrNnSsbiENzTnNaBsjxH0CNWGPhzHArOLFwo+oKXveA==", + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.6.0", + "@parcel/watcher-darwin-arm64": "2.6.0", + "@parcel/watcher-darwin-x64": "2.6.0", + "@parcel/watcher-freebsd-x64": "2.6.0", + "@parcel/watcher-linux-arm-glibc": "2.6.0", + "@parcel/watcher-linux-arm-musl": "2.6.0", + "@parcel/watcher-linux-arm64-glibc": "2.6.0", + "@parcel/watcher-linux-arm64-musl": "2.6.0", + "@parcel/watcher-linux-x64-glibc": "2.6.0", + "@parcel/watcher-linux-x64-musl": "2.6.0", + "@parcel/watcher-win32-arm64": "2.6.0", + "@parcel/watcher-win32-x64": "2.6.0" + } + }, + "node_modules/@parcel/watcher-android-arm64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.6.0.tgz", + "integrity": "sha512-trgpLSCKRC/huFjXX/Smh+0sWe4+YtKfktIToiMl59ghz7z+qkH6kMvNnUbLyRs9N11t8l4svSCs1+5B3rOAhA==", "cpu": [ "arm64" ], @@ -1779,12 +1929,19 @@ "optional": true, "os": [ "android" - ] + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.5.tgz", - "integrity": "sha512-bW7B8xMEq8n99Q3ieEcPRGuphurdZAaFzQc9Efyyw3FL6DZO6pMy9xhdN+kBoD7Sy05xNXSr4OyPPnpkYriS/A==", + "node_modules/@parcel/watcher-darwin-arm64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.6.0.tgz", + "integrity": "sha512-Y3QV0gl7Q1zbfueunkWIERICbEojQFCgpyG7YqOGNFLsckXyI1xu9mAIUpKY9QBYzBtSkN8dBPwd3yiAO9ovMw==", "cpu": [ "arm64" ], @@ -1793,12 +1950,19 @@ "optional": true, "os": [ "darwin" - ] + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.5.tgz", - "integrity": "sha512-YSwBS86QeHOGlrxJ1PSOIZSkzRL/JmKeunhc+lV6M1a6En8QuVCD/T/qIA0J4Gd2Y86RIOBYrLcOUtqGh9+/1w==", + "node_modules/@parcel/watcher-darwin-x64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.6.0.tgz", + "integrity": "sha512-Ohv6OpzhUfKYD7Beb8kDvG0jbIxORCYY1JRdZnaBtnjjkJxgD7ZVL0nw2sCYd0yTMKTvz3nnTnOF3cDifK+kvw==", "cpu": [ "x64" ], @@ -1807,26 +1971,19 @@ "optional": true, "os": [ "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.5.tgz", - "integrity": "sha512-2fST8lILgl7cKbme/1KDdPCmbXbG+gqoV3bHp19L0ypX/3akYMBVdOunPleRCwonoLnXOZ/0F+Mt/v8POFmfcQ==", - "cpu": [ - "arm64" ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.5.tgz", - "integrity": "sha512-cpIxQCP9J+EVad0a6LO1kY3ZGODlk80VlI+2I96B8xMcdHZ4pLVhfQ49JFpYqjPF91FFkQWftf57YlDcTiw9yQ==", + "node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.6.0.tgz", + "integrity": "sha512-5HmXvDgs8VK+74jF9y9/2FE3/OnlcKmc56tjmSrEuZjpSZOGL+fvAu+HKJBdPs9uwoP2hE6TlSUpXZ/C5jUFmQ==", "cpu": [ "x64" ], @@ -1835,100 +1992,422 @@ "optional": true, "os": [ "freebsd" - ] + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.5.tgz", - "integrity": "sha512-r9fGh3eFs3e/udWh5ZjXQtxiYK/xoFxQaYR/cELxac/Udkl5Th+IsFm0CX3Kl9hmUH/we7EoMpjJgeQNnE0+IA==", + "node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.6.0.tgz", + "integrity": "sha512-Ps/hui3A+vMbjdqlqAowK2ZL8+BO8dBjxeWXj6npTBs3jx4wWmbPpaLuqwrQrSqIVMCnpWo238bJ1U37GhQOYg==", "cpu": [ "arm" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.5.tgz", - "integrity": "sha512-xdvFdp7OM6KLJviJT2g/YuRSUjnZgGHk4RNgwIbN7X6cPugOucV60DdHXWzsBVCUdrGb6qSXnJQrrAKMmQuj3Q==", + "node_modules/@parcel/watcher-linux-arm-musl": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.6.0.tgz", + "integrity": "sha512-9c6AUHgHoG+IY88MRIHupztQiQnrbqHYQjkM2btA+Bf/wQnQMuiD0Wfk1EVv3TlNT3x41uU71rn6E4xh/+zvkw==", "cpu": [ "arm" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.5.tgz", - "integrity": "sha512-rRqILAndyzHzP7T9NFQrq+4HFWNhqkqkKur7eiBpfLmz01PO0JKx5Vchu3YllE4YXI/Ftgq/szrDWg5GJ0mI8g==", + "node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.6.0.tgz", + "integrity": "sha512-yHRqS2owEXe6Hic9z6Mh1ECsCd+ODVOGvZDyciqRd21+v+o+DnXMOrw50DSpIG2sb8GPEaPPmfeCAWKPJdq46g==", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.5.tgz", - "integrity": "sha512-Gf4X3qVMucayUvux6aXXPgXovocSFUC0rrffDuPI/S2nHhNMhjcZxsrAFYCOF350PRreW1XwzFj3CT/3bKsWCw==", + "node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.6.0.tgz", + "integrity": "sha512-WhB2e/V7rqdHHWZusBSPuy5Ei8S6lSz6FE5TKKQz5h3a0O+C+mhY7vxU9b/stqvMb8beLnPY82ZrFTLKs+SrKA==", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.5.tgz", - "integrity": "sha512-+s5qA0TNM0qm8PK/a5gt/1Hpx+NV08uSuCncvhziIlQzT6AEV2fnUQo7eBtFTFO0nA9scauvoR2HusfXmQnO4w==", + "node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.6.0.tgz", + "integrity": "sha512-ulGE6x6Oz6iAwg75T8YQSoguBWasniIbX+QWpaYPcCnDOpdWX3k+4xbEYPZVLxOuoJI+svJJPD3sEj8G7lrQ3A==", "cpu": [ - "loong64" + "x64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.5.tgz", - "integrity": "sha512-ybb6QvWwWJCbBWqERpc8K3pYVGIrXlG8MEQ8IIuJY6Y9KdHQxoFoNyfkAOtKn1VHu3KuLidXvwrvGR1mEjeWCw==", + "node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.6.0.tgz", + "integrity": "sha512-tkBYKt7YQrjIJWYDnto2YgO8MRkjlMTSNoRHzsXinBqbLdeOM3L32wPZJvIZxqaLMfSlS/4sUjH/6STVP/XDLw==", "cpu": [ - "loong64" + "x64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.5.tgz", - "integrity": "sha512-nZb1DtnOyhCmYvsC8A2CwOkopVg+IS1+fPUa7rMOAXtNw5+lLCLLPqd6XAiNrGtoQKsbvIBOwsHnBH/3wnb4HQ==", - "cpu": [ - "ppc64" ], - "dev": true, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-arm64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.6.0.tgz", + "integrity": "sha512-gIZAP23jaHjGWasY/TY6yL7NHFClf0Ga7FN+iINvk+KN94rhm94lYZhFsbYFNcA04/onvGD9kKmiJLJB2HbNwQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-x64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.6.0.tgz", + "integrity": "sha512-cA+/pXV2YkfxlIcXOQ5fSWqAzzPyD78/x5qbK/I0vUkrlYHA8TIz+MXjAbGouguKVSI4bOmkTSJ1/poVSsgt+A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@pkgr/core": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.3.6.tgz", + "integrity": "sha512-SEeaJLb3qBNF/OaXnaR1NmmBbFYk1zC0ZH/52fATcRPLFg/p791YrcyFFy44Bo9sLaGuSuLp5Q6axbb/O+v/RA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/pkgr" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.63.3.tgz", + "integrity": "sha512-w3Jnvi1ocaVm/c7yVPpfB98XeSRBMyzp6njL5MVVbGyXjpmUkN+s6Hp4t0PqhGCCaI1ZHMKXt/w0lA1RCaLVcw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.63.3.tgz", + "integrity": "sha512-uI/ESiaIbbRYAEhzy8PCUWDp1hB0bjAqM06mW9flOoNO4Q8DQpeoREhBR5Hegfl+wpXiguyJv6XSPzEN7OxyHQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.63.3.tgz", + "integrity": "sha512-oxhrd1jmXLwWZ83eQYDXxuqRdkqkzrjR3JobKeuUyfdNZo11FuQIvqEOZhyIT7OBHxXoGslDDjN0cQcM6T0TqQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.63.3.tgz", + "integrity": "sha512-7/YiIMghVE8DrxKvNdorAaJVdriOFgOIpdStnPx8ppx5zfTwC3jBCSEAIzB7JD5404m65THl6H93UTTVUvypmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.63.3.tgz", + "integrity": "sha512-GXFZRRoMAytaI5z6N3Zhfw0WL18Q0M8r95D5hlC4GqE/lGk8pbSJNUBoOWDfbm6dTciqHj2nU87tI5f6XhQiOg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.63.3.tgz", + "integrity": "sha512-77W+8X3ddYgPxUpB8nZFQs2Mq+wc4HVlcSRtApXLjYBcnPMkttrSnU8VwKQjeWYhMsITHFs5cWBQ8vz1Q+5RHQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.63.3.tgz", + "integrity": "sha512-FVkwK+iUC+mq+GipVK46rRVticfAPtvPUNlqlGXUDxdVk/UGjQiiiUVPUrEXdSpU2ufU0XxLGyTqDtBidDOVmg==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.63.3.tgz", + "integrity": "sha512-+aGU1t3398yQOVj1Bz8o3e+KtswxAPvO+mtxtNdfXYMkXIHu7XhhkCD7/DEH9q8tF8uhDnMWvfpUKI8y1sZJsg==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.63.3.tgz", + "integrity": "sha512-cR0kjpRXR2KJ2oQK8E2KTPtphs+b9hZ8IhTZubNryt/RsqgdOZBQ2Zq0q5UedtiIi0rs3jVhJh55RE1ZHUVGUA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.63.3.tgz", + "integrity": "sha512-y1RYi4Q3/9ByVWSSt9kX2ustE0B7kFYbJ6zZdVZVyqopZs3yhCTwRfrjIX4vezUJInma/Gs6BOFDJg7yZmJ0IQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.63.3.tgz", + "integrity": "sha512-DNhEA5viIj3Z5bZLE4z4oV8N5ozWqDwyt7T6KG7VdLDJ0nW+rNOYlphBl4/3HQkK75qipPLsVOfStHHOwN9WSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.63.3.tgz", + "integrity": "sha512-17gQCqrIpXBX2Cmi9/TygnVOqGbzsba/iaqcYSL8FY7lNugg+7AiYNs5c5nKWD+NRQha36Sa0CqkJqH4XVHwnQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.63.3.tgz", + "integrity": "sha512-6LwVnZRIyINpdku/yOcI8Tm9YqLmhHK5emmlOOnW9tO0SYEm1FmKPcsSAGp0NBlqR2P04xaND4jvN6sTHqhq8A==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1936,13 +2415,16 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.5.tgz", - "integrity": "sha512-yMbj63Sp89ryrXLWyz+sy+fYD2HpOnMCLGbe4Oa1smclFSUukdtD/BgdiHaAetJNb74URD8U4hM+qG5KVzMEkg==", + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.63.3.tgz", + "integrity": "sha512-xMUqkTXlEUtI/p5AAukMwBRr1enU3efsTeF+bskeFfk8t1C9rcC8sLREcZXmTfAXEbvRdJVSonVJez3TMlbR3w==", "cpu": [ "ppc64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -1950,13 +2432,16 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.5.tgz", - "integrity": "sha512-mhoan3OJw2kYV/e1jtIdmvUZgyBFeA6zGWsOswmR0Tg19TQbowZuR+JMLID6spbbBN7Zee2ejrgmy3+FxGrIdA==", + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.63.3.tgz", + "integrity": "sha512-S3E94co9F9WRRqEaUoQZ38K1gCz6KiM+nL7/3ijq7fDGF3OznjS5TasgYITlvl27GQKtu4lOAOsr5MFwkijvOA==", "cpu": [ "riscv64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1964,13 +2449,16 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.5.tgz", - "integrity": "sha512-5ZTLmjWbb1VZdjuyhe83K/8QO0/h11midQCBP+X5OYn32ra7eOBoM0ZqtaY4nkgNsYgmdVhMYPoyVPTjUpHf3w==", + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.63.3.tgz", + "integrity": "sha512-1QtRDwG42x5BJI3s9mxu5rEjDnfbSnk20HQ9/ylTAYnSwYwxMVb+Vgu34wzzTQ7ogqBybebgQNUDAvZVQ38DbA==", "cpu": [ "riscv64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -1978,13 +2466,16 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.5.tgz", - "integrity": "sha512-m53kG+br6PGxOTmgBEM2DHSDs9RVjsyEbUwjJPJGTFm1grWOG8EKJggDCTb60unD4Tjby8fi7/m9XfkEWasVWg==", + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.63.3.tgz", + "integrity": "sha512-BQhejF6ZXOpxbngiNTP12GCGQeaDVL2QXGeBVViKIYzFHM5RKxTxwUMB1fr1BeNFphFMpnRqC5QSXFSa4z6UQw==", "cpu": [ "s390x" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1992,13 +2483,16 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.5.tgz", - "integrity": "sha512-6RHPJR1g/uvdYU8uXBnfq3nlqyZCP82Fr6NHgfGoaIeSh0YEqnX/x6uA9MmJJbnSH7swqX4F+CkGdUF+6doiQA==", + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.63.3.tgz", + "integrity": "sha512-SXagRwnI2Wlwlitllu59UK/nGVbD1CKPcNqDplHwIC4BqJcpXFjD32d1R/RbuISa95HdQrZM3/7v4bKiowFaLA==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2006,13 +2500,16 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.5.tgz", - "integrity": "sha512-xs+OXQtEXgpXT0DmA5+U3qnRZHdCST/5HRQxS8wSPZTUZN/EMWeHuSIod32LQklTBZBV9DyfncKBQ8n5V3eFdw==", + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.63.3.tgz", + "integrity": "sha512-2IPozoEALRCziGqE8O9KMK60PMu5TS1huv4fwoeCexj+WjmcwFtX9CTOVbfXCUqcELAubEwRFPYlzb/WvwY2HQ==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -2020,9 +2517,9 @@ ] }, "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.5.tgz", - "integrity": "sha512-e7hD+sl3s+mcLQDZ8pbudBVsdG6r5yN4w3LqG2TJ8sQHDpblWj5lrJs/3m01Cvlxbt4x13zu5thLjgypgtkYzw==", + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.63.3.tgz", + "integrity": "sha512-AoxqosUHT9IX54hFn2TiN6A7d6ZKTtE6pd2bqWtqkkNJ6HJGaU6FRouGX8L1O7R/ZwsnCnpQrHzb4pDEx+UHRQ==", "cpu": [ "x64" ], @@ -2034,9 +2531,9 @@ ] }, "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.5.tgz", - "integrity": "sha512-GiyJaCf+WpMub/17aPcKk27QMl5W6f+KhdPTjlFOn5akH5Wa/DCM9Stdx5cDfmasyKB08MqpVQ1uJE2RkkpbXg==", + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.63.3.tgz", + "integrity": "sha512-d+CaftKgmkFBzCwezMqqy1d0QNNYugqLCMcYVQWBy5SS2YfeMP8Q8ripkgx9O8IyBXXLHrJ+aaCV4U96usv6Yg==", "cpu": [ "arm64" ], @@ -2048,9 +2545,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.5.tgz", - "integrity": "sha512-+OQ8U2DdoEfXl8T4Fb18AjmEwbXMerKDKCL8yCPAYhKCEEKoul7rkbeGCBFCbAlaGaa7pmtRTpkAJM2LE/i5FA==", + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.63.3.tgz", + "integrity": "sha512-xXlDF6nR1eOuXbdDy5Hl5fmtY7teUDevF/k0O7IPoZe4Tpmdv+lgdE5JRsnhQtt37ql9P0VF2kAN9a0OCZdo+Q==", "cpu": [ "arm64" ], @@ -2062,9 +2559,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.5.tgz", - "integrity": "sha512-KanvAZrPKbDBFwrgiU9yEVpQoox9QPV1WZOXX7HudJQY+eSlu82CtWxDU8WtuRRvtN5EGkLczkd6Y6DTcvm9wA==", + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.63.3.tgz", + "integrity": "sha512-YtXAgLN+JP7Ay6qG3eWhc7IHMQPzLc8r3uvhAvlJIoCz/4Q32+Bl9Fmnywidh8v1GOIMmymjovfqY9ETAtysvA==", "cpu": [ "ia32" ], @@ -2076,9 +2573,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.5.tgz", - "integrity": "sha512-1aC3UEWTtRl3RK3VpDJ/Tqk1XI4SLTmXIthAq6wRWo8XiSXJNd+VprJM4/1P4+i6HIaFEFlVi9sTTziniD2tOQ==", + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.63.3.tgz", + "integrity": "sha512-WuWtSJRNo549vzcfZyEgfqb6zeSgn1F+UE5kQ+BCjzz0W4MGCjntUHkZVc1VRuAM7+ULaSyhiPxD1spyewFvkQ==", "cpu": [ "x64" ], @@ -2090,9 +2587,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.5.tgz", - "integrity": "sha512-/gDJaRs4gl0NPIwqCz+6PkpmhhjRAD2j6P4rSNHBzUkO3naEx2mIU0pRle1vUNRQ7mE/+8OOeXLTv/J56FKiQg==", + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.63.3.tgz", + "integrity": "sha512-+lIKX7O0+IGe7WuhATaAMMeT7B76vfhXH/l9wLQL+nvyhbw2ohYCKIdWL56JfDu75CWt5oKRP4QFH/jkMtBquA==", "cpu": [ "x64" ], @@ -2131,9 +2628,9 @@ } }, "node_modules/@tybys/wasm-util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz", - "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.4.tgz", + "integrity": "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==", "dev": true, "license": "MIT", "optional": true, @@ -2242,13 +2739,13 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "26.2.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.2.0.tgz", - "integrity": "sha512-5IviulTZeRNp2vAJ514cc/HUlY5nZ9fCbq9DMyC52BrhFZACo3nI0R7qBxhQmo/d27NFe96ur/b7Wwxklda+kg==", + "version": "26.5.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.5.1.tgz", + "integrity": "sha512-CzNm2FezW4VR/LjG6yUdiEgLE/rAQ9Slj5gCu/C2VrdcW7I0ahNZ8DRbHT7zOZ6r3ONgd/bsQIeSaoDGrd1C6g==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~8.3.0" + "undici-types": "~8.9.0" } }, "node_modules/@types/stack-utils": { @@ -2276,17 +2773,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.67.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.67.0.tgz", - "integrity": "sha512-Un7Heoyj65NREbKAyIrFxeM143NZpExWmy1Nep4DLeQOeLlTeumPjoNKnBrU5D5moWXbPJgRa5Uwcdu0faVNGQ==", + "version": "8.70.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.70.0.tgz", + "integrity": "sha512-/v8HZt6RlyIZxB3ntehELOcUcfxKPVGWXnQdJuHRmzrqgF8nQypcC/oxGW+Ot4VGKDq81XugPKxx0n5PBtf9PA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.67.0", - "@typescript-eslint/type-utils": "8.67.0", - "@typescript-eslint/utils": "8.67.0", - "@typescript-eslint/visitor-keys": "8.67.0", + "@typescript-eslint/scope-manager": "8.70.0", + "@typescript-eslint/type-utils": "8.70.0", + "@typescript-eslint/utils": "8.70.0", + "@typescript-eslint/visitor-keys": "8.70.0", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" @@ -2299,15 +2796,15 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.67.0", + "@typescript-eslint/parser": "^8.70.0", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.6.tgz", - "integrity": "sha512-BAg6QkE8W+TuQLrrw0Ugr7HegXduRuuj8/ti2kSOc+jz1dmx8/WNcjr6XGnq5YpDWxFwwaavqD0+jIUOKelTsw==", + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.9.tgz", + "integrity": "sha512-brTTsvFRt5C1gGHtPst/281UjPD5t9fBqbgoMPlVWy11ZLTPfu7HxK4ZYqO9H7o/yC9rSTCI85EaQ4OoY12qYw==", "dev": true, "license": "MIT", "engines": { @@ -2315,16 +2812,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.67.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.67.0.tgz", - "integrity": "sha512-fUBfTuuEulWqX6V8+O3PtScV01tzYYRUDTAirHFKoRAt7nOzoGiPt0M/bB47wWNy0coOOcgEwAMUtBpykMxl6w==", + "version": "8.70.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.70.0.tgz", + "integrity": "sha512-zYvrmj9Yxd63UGaXw+kdt6A0F0s0qveJyuatIM77bYC2DE4pgmg7a50u8LR7PRtXd0x+h+Tl3eXabGm06SWd3Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.67.0", - "@typescript-eslint/types": "8.67.0", - "@typescript-eslint/typescript-estree": "8.67.0", - "@typescript-eslint/visitor-keys": "8.67.0", + "@typescript-eslint/scope-manager": "8.70.0", + "@typescript-eslint/types": "8.70.0", + "@typescript-eslint/typescript-estree": "8.70.0", + "@typescript-eslint/visitor-keys": "8.70.0", "debug": "^4.4.3" }, "engines": { @@ -2340,14 +2837,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.67.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.67.0.tgz", - "integrity": "sha512-cvE8c7ulYeXN9fYuszhCeCsbzyVEXuhrRCybnBre7TUmqb5nRmBfQAwCj0O3WJFDeyAZt4VYv51vMCC9LHSdYw==", + "version": "8.70.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.70.0.tgz", + "integrity": "sha512-hFHbTNqhU9G+2eKFXCBVb1tjFT/LceiJ4+HfLO4pTpDI0KHi6iajpcFFkaSQ9gXmCh7n82A0PthaayEdN6mspQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.67.0", - "@typescript-eslint/types": "^8.67.0", + "@typescript-eslint/tsconfig-utils": "^8.70.0", + "@typescript-eslint/types": "^8.70.0", "debug": "^4.4.3" }, "engines": { @@ -2362,14 +2859,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.67.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.67.0.tgz", - "integrity": "sha512-EgvsleTwS4E+WzzSvem8fAUubLwatMNF1B5hHSLQxcvs7q2dtRhGyujHwLJSYlG41niJ7GP24Aha2+0mb1b2kg==", + "version": "8.70.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.70.0.tgz", + "integrity": "sha512-8nP3Kwh5hlgZ4FicGvmznAmJe8UL4sdU8tLukrPaMuQmDuk4Y8xYfzu/aYZW4xT2JCgc7H/TpDI5cGlxcWJSqQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.67.0", - "@typescript-eslint/visitor-keys": "8.67.0" + "@typescript-eslint/types": "8.70.0", + "@typescript-eslint/visitor-keys": "8.70.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2380,9 +2877,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.67.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.67.0.tgz", - "integrity": "sha512-vV+LUSv5njUWsknE71fqKTlXUva+R76SaeORd6Zojcunk/6DvKFXONU3BrAs2H49mbygUXt6gbYunzwqNwlhdg==", + "version": "8.70.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.70.0.tgz", + "integrity": "sha512-adnkeeNq9Sq1sUf4+FRVc0KdgYghzsgFpZSQVZVvY0LCuUuN0FnQgyGzCJeC4fW1cdXseBAjU2EOqUIjbNcZUw==", "dev": true, "license": "MIT", "engines": { @@ -2397,15 +2894,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.67.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.67.0.tgz", - "integrity": "sha512-aVWDXbRmdXO9siTfX4ditQI1T9+zVcNazT48EJCD0v40/9RIFoUgZ05CmGEq9H2gixRpjUn/iplwvlcvutJW/Q==", + "version": "8.70.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.70.0.tgz", + "integrity": "sha512-NUMKIhYVaVIVLnRL9CRt+VVcuLgSHUCpXn4/+K8wql+vdInUzvx8BjUO1oJ7cG9shjFJKtF8F8Hh2kCh3/KBVw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.67.0", - "@typescript-eslint/typescript-estree": "8.67.0", - "@typescript-eslint/utils": "8.67.0", + "@typescript-eslint/types": "8.70.0", + "@typescript-eslint/typescript-estree": "8.70.0", + "@typescript-eslint/utils": "8.70.0", "debug": "^4.4.3", "ts-api-utils": "^2.5.0" }, @@ -2422,9 +2919,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.67.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.67.0.tgz", - "integrity": "sha512-sBtgslww8nsMYUjhdPBiSyUqSzT8uR6g93A2QXnQC8+cGdjz0CyaOdqHDRJb1AtORbZCNUJBBeFA/tNR2uQmww==", + "version": "8.70.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.70.0.tgz", + "integrity": "sha512-asTOIYhDg4zdzOScCyaytrsV3cR6B4ecPQlXw/dJIm7J/MZTtCtfVII9JD8Geh4jTCrK/Xe6cg5UevoleMcoJQ==", "dev": true, "license": "MIT", "engines": { @@ -2436,16 +2933,16 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.67.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.67.0.tgz", - "integrity": "sha512-EKQBCE9yNlRJYm7jdTW5AhDacDUmSwQb0FAJAmK2EKYrNXIsa2vxcSZx6PvJ/dEdI6lS+Y9W+EXckLj0iPFGcw==", + "version": "8.70.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.70.0.tgz", + "integrity": "sha512-d9NmHMPEKQ7QCLLm1jI3zmoQBwT5KwFYjXBJ9ymZfKCUU+5rmTRykKAFvH5Qn/ZCds3CEAFS9OC9M/jkl0X2bA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.67.0", - "@typescript-eslint/tsconfig-utils": "8.67.0", - "@typescript-eslint/types": "8.67.0", - "@typescript-eslint/visitor-keys": "8.67.0", + "@typescript-eslint/project-service": "8.70.0", + "@typescript-eslint/tsconfig-utils": "8.70.0", + "@typescript-eslint/types": "8.70.0", + "@typescript-eslint/visitor-keys": "8.70.0", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", @@ -2477,16 +2974,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.67.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.67.0.tgz", - "integrity": "sha512-U9D1FdwEWBwok3hxxSdhclMb0twvt9QnjIQ0VfQ1AiX2epnpSgv2ubVDsayOFyY8K6FX+AQ7E0FKWVG3iKsj1A==", + "version": "8.70.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.70.0.tgz", + "integrity": "sha512-oZmtKJz/4fufZ2p3+Cn3ijEojcdfR+1zYDH2xKYrEly0dR/Q/1xUPRCOlKGxod78nWlU2UnDe09GZ3TaknBFGA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.67.0", - "@typescript-eslint/types": "8.67.0", - "@typescript-eslint/typescript-estree": "8.67.0" + "@typescript-eslint/scope-manager": "8.70.0", + "@typescript-eslint/types": "8.70.0", + "@typescript-eslint/typescript-estree": "8.70.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2501,13 +2998,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.67.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.67.0.tgz", - "integrity": "sha512-fkv8dHRDqfGtTHuJeebdrQ7cX6Ad4WAS00rgHh9UGvMycF1mjBfsxry1XsLIFhWZ6Judlh6UdzK+TYlbpCXgnA==", + "version": "8.70.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.70.0.tgz", + "integrity": "sha512-BoC8PiO4Hkdo0TVJh9Ntxr5MxPDI7/oFsrygN5ADelFSeXG/qgNuucIGA+L5Z6JpPTE/uRfcTWtscjbUaufepQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.67.0", + "@typescript-eslint/types": "8.70.0", "eslint-visitor-keys": "^5.0.0" }, "engines": { @@ -2519,9 +3016,9 @@ } }, "node_modules/@ungap/structured-clone": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.3.tgz", - "integrity": "sha512-60YRaenCQcVjYEKOcG824+DRGGIQ3VKErcBoAEDJZz5bKIs2ZG+X/H9Nk+Q6EVkwJk5QNApxbrc5QtBSwtrXAg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.4.0.tgz", + "integrity": "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==", "dev": true, "license": "ISC" }, @@ -2631,6 +3128,9 @@ "arm64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2645,6 +3145,9 @@ "arm64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -2659,6 +3162,9 @@ "loong64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2673,6 +3179,9 @@ "loong64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -2687,6 +3196,9 @@ "ppc64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2701,6 +3213,9 @@ "riscv64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2715,6 +3230,9 @@ "riscv64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -2729,6 +3247,9 @@ "s390x" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2743,6 +3264,9 @@ "x64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -2757,6 +3281,9 @@ "x64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -2895,16 +3422,13 @@ } }, "node_modules/ansi-regex": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.3.0.tgz", - "integrity": "sha512-WpDfL7NO6j7tH88IDBNVdUJxDh9nmCteAVW9dsep846XdwF4naCBK+/tGLX3KJgcpgMRXCFlTM2hKGoK9FsdrQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "node": ">=8" } }, "node_modules/ansi-styles": { @@ -2965,16 +3489,16 @@ "license": "Python-2.0" }, "node_modules/babel-jest": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.4.1.tgz", - "integrity": "sha512-fATAbM8piYxkiXQp3RBXmZHxZVNJZAVXXfyeyCN2Tida3+qJ8ea9UxhiJ2y4fLO90ZImKt6k9FlcH2+rLkJGhw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.5.1.tgz", + "integrity": "sha512-ge1xUVZS91ml09YRMgRGgeKJ4YJpcOiuwteAxFBYLugQyp7cRw+hHej6Ho0vPjvLrjq60bb7JPHH9LAMA1/krA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/transform": "30.4.1", + "@jest/transform": "30.5.1", "@types/babel__core": "^7.20.5", - "babel-plugin-istanbul": "^7.0.1", - "babel-preset-jest": "30.4.0", + "babel-plugin-istanbul": "^8.0.0", + "babel-preset-jest": "30.5.0", "chalk": "^4.1.2", "graceful-fs": "^4.2.11", "slash": "^3.0.0" @@ -2987,9 +3511,9 @@ } }, "node_modules/babel-plugin-istanbul": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-7.0.1.tgz", - "integrity": "sha512-D8Z6Qm8jCvVXtIRkBnqNHX0zJ37rQcFJ9u8WOS6tkYOsRdHBzypCstaxWiu5ZIlqQtviRYbgnRLSoCEvjqcqbA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-8.0.0.tgz", + "integrity": "sha512-18wCskrN3DgbuBmp1gr7LBGT8xdz5xhQQqFvFhVxbkl8VBCrMKQ2YtqBWtUal1Zrc1HTuX0011+Brjw78TCFkg==", "dev": true, "license": "BSD-3-Clause", "workspaces": [ @@ -3000,16 +3524,16 @@ "@istanbuljs/load-nyc-config": "^1.0.0", "@istanbuljs/schema": "^0.1.3", "istanbul-lib-instrument": "^6.0.2", - "test-exclude": "^6.0.0" + "test-exclude": "^7.0.1" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/babel-plugin-jest-hoist": { - "version": "30.4.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-30.4.0.tgz", - "integrity": "sha512-9EdtWM/sSfXLOGLwSn+GS6pIXyBnL07/8gyJlwFXjWy4DxMOyItqyUT29d4lQiS380EZwYlX7/At4PgBS+m2aA==", + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-30.5.0.tgz", + "integrity": "sha512-gtGo1B+u14jrZQv6TdSWIWkTqclboo7Qn+dFAGUOIuXLFuJKAdg3U5MIWzZnW4vfUb4dX9skmAMiby86e/SF4A==", "dev": true, "license": "MIT", "dependencies": { @@ -3047,20 +3571,20 @@ } }, "node_modules/babel-preset-jest": { - "version": "30.4.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-30.4.0.tgz", - "integrity": "sha512-lBY4jxsNmCnSiu7kquw8ZC9F4+XLMOKypT3RnNHPvU2Kpd4W0xaPuLr5ZkRyOsvLYAY4yaW1ZwTW4xB7NIiZzg==", + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-30.5.0.tgz", + "integrity": "sha512-ZGPn5ClP4lBDpuOK8W1yQIOy359HmbnZv3suucAlIe+SEE9yDsxV4S2PjSbH2Vc97U+WmzYD7vw3kr8NsQ/i6w==", "dev": true, "license": "MIT", "dependencies": { - "babel-plugin-jest-hoist": "30.4.0", + "babel-plugin-jest-hoist": "30.5.0", "babel-preset-current-node-syntax": "^1.2.0" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { - "@babel/core": "^7.11.0 || ^8.0.0-beta.1" + "@babel/core": "^7.11.0 || ^8.0.0-beta.1 || ^8.0.0" } }, "node_modules/balanced-match": { @@ -3074,9 +3598,9 @@ } }, "node_modules/baseline-browser-mapping": { - "version": "2.11.19", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.19.tgz", - "integrity": "sha512-Grytf1xOxOEMTGRwx6rLGKkTabd4vMg3VrKdj/7joCmV0qgh4QwMMO6xh34YEXQqirAuUdgQGa5orJQQ+69RBw==", + "version": "2.11.24", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.24.tgz", + "integrity": "sha512-hYrgxie335U08WqICoGqKRzV1HFXv6zdxwJE4ekCb80CM9a0SVVsN4QPwT67RraRo+9h8IATk6uxHJw7QSkdOg==", "dev": true, "license": "Apache-2.0", "bin": { @@ -3109,9 +3633,9 @@ } }, "node_modules/browserslist": { - "version": "4.28.8", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.8.tgz", - "integrity": "sha512-V2NpofLblG64mfOtSgDhOJESZEGogzDMBv/q+W6oc4LXWP/q75eOXoOaaOu1EOadB9U4Bwx/e0yzbvwKH8zalA==", + "version": "4.29.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.0.tgz", + "integrity": "sha512-3GSvyjvDI4Dur1Meg2BekJquu5uF+9R9a1+5M1Mde192eZoXbeXjzgOsgqPS2V8D5wrrip0gR5Hf/GhWQ9ZzaA==", "dev": true, "funding": [ { @@ -3129,11 +3653,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.11.12", - "caniuse-lite": "^1.0.30001809", - "electron-to-chromium": "^1.5.402", - "node-releases": "^2.0.53", - "update-browserslist-db": "^1.3.0" + "baseline-browser-mapping": "^2.11.23", + "caniuse-lite": "^1.0.30001810", + "electron-to-chromium": "^1.5.427", + "node-releases": "^2.0.55", + "update-browserslist-db": "^1.3.3" }, "bin": { "browserslist": "cli.js" @@ -3152,13 +3676,6 @@ "node-int64": "^0.4.0" } }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "license": "MIT" - }, "node_modules/bundle-require": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz", @@ -3185,6 +3702,20 @@ "node": ">=8" } }, + "node_modules/cacheable": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/cacheable/-/cacheable-2.5.0.tgz", + "integrity": "sha512-60cyAOytib/OzBw1JNSoSV/boK1AtHryDIjvVBk7XbN4ugfkM3+Sry7fEjNgPMGgOjuaZPAp8ruZ0Cxafwyq9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cacheable/memory": "^2.2.0", + "@cacheable/utils": "^2.5.0", + "hookified": "^1.15.0", + "keyv": "^5.6.0", + "qified": "^0.10.1" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -3307,73 +3838,10 @@ "node": ">=12" } }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/cliui/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "dev": true, "license": "MIT", "engines": { @@ -3507,6 +3975,16 @@ "node": ">=0.10.0" } }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -3525,9 +4003,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.413", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.413.tgz", - "integrity": "sha512-F1XPKvt7HVfly5WND90ec16nFsdr4g5x/cVUP3EqjeyXynupabGDqpMa84wwvuYGDnldXLBz6DLXyZXWO9TPvw==", + "version": "1.5.430", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.430.tgz", + "integrity": "sha512-e1QEj72Y4zd8RlNZVmoTg+iCOSVwpk05IOiiQwdrkwCSVlZfPthevErhE+nckGd2YbsXfp1SkisznhGVIXP2NQ==", "dev": true, "license": "ISC" }, @@ -3545,9 +4023,9 @@ } }, "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true, "license": "MIT" }, @@ -3561,6 +4039,13 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-module-lexer": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.2.tgz", + "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==", + "dev": true, + "license": "MIT" + }, "node_modules/esbuild": { "version": "0.28.2", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", @@ -3638,9 +4123,9 @@ } }, "node_modules/eslint": { - "version": "10.9.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.9.0.tgz", - "integrity": "sha512-5KeEOJZBfEVA47boFiBsf+6MmmJpffM7qEBg4pLla2e4nlKgdKlqCW0oSLOGsT8Wl5uCGJptLV1bkaiShj90Gw==", + "version": "10.10.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.10.0.tgz", + "integrity": "sha512-NPXn6r5zl4uET1DAVPaOwzX3rut4c0wcmw3dWJAfOsTM5+TogXo0DDjz8pwm/hL8cyVNpHqeK4JpN0NjnyFFNw==", "dev": true, "license": "MIT", "workspaces": [ @@ -3652,7 +4137,7 @@ "@eslint/config-array": "^0.23.5", "@eslint/config-helpers": "^0.7.0", "@eslint/core": "^1.2.1", - "@eslint/plugin-kit": "^0.7.2", + "@eslint/plugin-kit": "^0.7.3", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", @@ -3667,7 +4152,7 @@ "esquery": "^1.7.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^8.0.0", + "file-entry-cache": "11.1.5 || >11.1.6 <12", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", @@ -3816,13 +4301,6 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/execa/node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, - "license": "ISC" - }, "node_modules/exit-x": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/exit-x/-/exit-x-0.2.2.tgz", @@ -3834,18 +4312,18 @@ } }, "node_modules/expect": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/expect/-/expect-30.4.1.tgz", - "integrity": "sha512-PMARsyh/JtqC20HoGqlFcIlQAyqUtW4PlI1rup1uhYJtKuwAjbvWi3GQMAn+STdHum/dk8xrKfUM1+5SAwpolA==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/expect/-/expect-30.5.1.tgz", + "integrity": "sha512-m8YrYgvKe9+9gEnWEuKz+qCGfHqkrff7PPfyDnOFkjsfYRKqiYyOxDFMFieCGAuhtk/VNm63tvNgKZVzVy+Hvg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/expect-utils": "30.4.1", - "@jest/get-type": "30.1.0", - "jest-matcher-utils": "30.4.1", - "jest-message-util": "30.4.1", - "jest-mock": "30.4.1", - "jest-util": "30.4.1" + "@jest/expect-utils": "30.5.1", + "@jest/get-type": "30.5.0", + "jest-matcher-utils": "30.5.1", + "jest-message-util": "30.5.1", + "jest-mock": "30.5.1", + "jest-util": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" @@ -3901,16 +4379,13 @@ } }, "node_modules/file-entry-cache": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "version": "11.1.5", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-11.1.5.tgz", + "integrity": "sha512-+PFTHITI08JIGhnNpGNI8T8inUpgZfk3GNEqfT9R2zZV2iFXg3CvqzSl/uEhs7TSGujYRELEANyDvS8Fj7+S7Q==", "dev": true, "license": "MIT", "dependencies": { - "flat-cache": "^4.0.0" - }, - "engines": { - "node": ">=16.0.0" + "flat-cache": "^6.1.23" } }, "node_modules/find-up": { @@ -3943,17 +4418,15 @@ } }, "node_modules/flat-cache": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "version": "6.1.23", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-6.1.23.tgz", + "integrity": "sha512-f++BY9pTk+983xK1FLzlLpmM0i0z+jHmx3QESGkURMXujQZz1k5wzwX6hjnQ8goaD0B+sYnDK1yZ6MTyZfUaqA==", "dev": true, "license": "MIT", "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.4" - }, - "engines": { - "node": ">=16" + "cacheable": "^2.5.0", + "flatted": "^3.4.2", + "hookified": "^1.15.0" } }, "node_modules/flatted": { @@ -3980,12 +4453,18 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "license": "ISC" + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, "node_modules/fsevents": { "version": "2.3.3", @@ -4046,22 +4525,18 @@ } }, "node_modules/glob": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", - "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", - "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", "dev": true, - "license": "ISC", + "license": "BlueOak-1.0.0", "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" }, - "bin": { - "glob": "dist/esm/bin.mjs" + "engines": { + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -4080,22 +4555,6 @@ "node": ">=10.13.0" } }, - "node_modules/glob/node_modules/minimatch": { - "version": "9.0.9", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", - "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.2" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/globals": { "version": "16.5.0", "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz", @@ -4126,6 +4585,26 @@ "node": ">=8" } }, + "node_modules/hashery": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/hashery/-/hashery-1.5.1.tgz", + "integrity": "sha512-iZyKG96/JwPz1N55vj2Ie2vXbhu440zfUfJvSwEqEbeLluk7NnapfGqa7LH0mOsnDxTF85Mx8/dyR6HfqcbmbQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "hookified": "^1.15.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/hookified": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/hookified/-/hookified-1.15.1.tgz", + "integrity": "sha512-MvG/clsADq1GPM2KGo2nyfaWVyn9naPiXrqIe4jYjXNZQt238kWyOGrsyc/DmRAQ+Re6yeo6yX/yoNCG5KAEVg==", + "dev": true, + "license": "MIT" + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -4183,25 +4662,6 @@ "node": ">=0.8.19" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dev": true, - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "license": "ISC" - }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -4373,16 +4833,16 @@ } }, "node_modules/jest": { - "version": "30.4.2", - "resolved": "https://registry.npmjs.org/jest/-/jest-30.4.2.tgz", - "integrity": "sha512-Yi1jqNC/Oq0N4hBgNH/YvBpP1P57QqundgytzYqy3yqAa7NZPNjSoi4SGbRAXDMdBzNE6xBCi5U7RgfrvMEUVQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest/-/jest-30.5.1.tgz", + "integrity": "sha512-3qrR8+ZXFnn7y0H2yjWQNkGGBLBY4zTRoTMAq9zJcgwLLtlyonfsCLviIXK9xuE2KgIyM+M36AFcoK2DgFR36w==", "dev": true, "license": "MIT", "dependencies": { - "@jest/core": "30.4.2", - "@jest/types": "30.4.1", + "@jest/core": "30.5.1", + "@jest/types": "30.5.1", "import-local": "^3.2.0", - "jest-cli": "30.4.2" + "jest-cli": "30.5.1" }, "bin": { "jest": "bin/jest.js" @@ -4400,14 +4860,14 @@ } }, "node_modules/jest-changed-files": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-30.4.1.tgz", - "integrity": "sha512-IuctmYrxi21iOSOaIXpJWalHyPAsVv0GeBHKDn8C1CA4W5htHn7INL+wdnL4Bo0+olEndvAFkmb++tIQJG+vvg==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-30.5.1.tgz", + "integrity": "sha512-0+bvMM/ENhDI29Z8q1r4HxiDIi4G5tnBmSw4esfPQoj9q8Nik7KIyuxHkTVnnniJQf05SxpGaKDQ+4h28ynGPg==", "dev": true, "license": "MIT", "dependencies": { "execa": "^5.1.1", - "jest-util": "30.4.1", + "jest-util": "30.5.1", "p-limit": "^3.1.0" }, "engines": { @@ -4415,29 +4875,29 @@ } }, "node_modules/jest-circus": { - "version": "30.4.2", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.4.2.tgz", - "integrity": "sha512-rvHH7VlY6LgbJXJTQ87GW62g1FntOtbhh0zT+v04kC+pgL6aBKyYINXxWukCpj3dcIBMw5/XUbtDS9dU9JTXeQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.5.1.tgz", + "integrity": "sha512-NgliezXQ6yznqR4W5Gqw++0cZSbBZlF0NknNIAE5VmSJKWOtmWJmWnBq3TSkUOVBTPrT7FGGhVdA8DLWnxo2Sw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "30.4.1", - "@jest/expect": "30.4.1", - "@jest/test-result": "30.4.1", - "@jest/types": "30.4.1", + "@jest/environment": "30.5.1", + "@jest/expect": "30.5.1", + "@jest/test-result": "30.5.1", + "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", "co": "^4.6.0", "dedent": "^1.6.0", "is-generator-fn": "^2.1.0", - "jest-each": "30.4.1", - "jest-matcher-utils": "30.4.1", - "jest-message-util": "30.4.1", - "jest-runtime": "30.4.2", - "jest-snapshot": "30.4.1", - "jest-util": "30.4.1", + "jest-each": "30.5.1", + "jest-matcher-utils": "30.5.1", + "jest-message-util": "30.5.1", + "jest-runtime": "30.5.1", + "jest-snapshot": "30.5.1", + "jest-util": "30.5.1", "p-limit": "^3.1.0", - "pretty-format": "30.4.1", + "pretty-format": "30.5.1", "pure-rand": "^7.0.0", "slash": "^3.0.0", "stack-utils": "^2.0.6" @@ -4447,21 +4907,21 @@ } }, "node_modules/jest-cli": { - "version": "30.4.2", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.4.2.tgz", - "integrity": "sha512-jfA2ocvVHMXS2QijrJ0d31ektP+d/W0T5RpcTX2Pq+3sVqHlsXVCM2+FmwpL+bdY8OfHpIg9xMxLF17Zg0U49Q==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.5.1.tgz", + "integrity": "sha512-uwNYepWgaNBCplm42fCIUZTf/tIEHIy5AYvx7eL1BrwIgyjPt+2poouR23UO2yopIP+kV8oZFHfv+l4pg/8prQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/core": "30.4.2", - "@jest/test-result": "30.4.1", - "@jest/types": "30.4.1", + "@jest/core": "30.5.1", + "@jest/test-result": "30.5.1", + "@jest/types": "30.5.1", "chalk": "^4.1.2", "exit-x": "^0.2.2", "import-local": "^3.2.0", - "jest-config": "30.4.2", - "jest-util": "30.4.1", - "jest-validate": "30.4.1", + "jest-config": "30.5.1", + "jest-util": "30.5.1", + "jest-validate": "30.5.1", "yargs": "^17.7.2" }, "bin": { @@ -4480,33 +4940,33 @@ } }, "node_modules/jest-config": { - "version": "30.4.2", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.4.2.tgz", - "integrity": "sha512-rNHAShJQqQwFNoL0hbf3BphSBOWnpOUAKvidLS/AjNVLPfoj5mSf4jQMfW3cYOs6hXeZC7nF7mDHaBnbxELOzg==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.5.1.tgz", + "integrity": "sha512-L8PKM2X/ngG8PxfLMqglKGZjylPgw84bVPUlMY9W/o76TnLqPWrmQgsaT0HrheGdRtpGE5FbmREA0Kvb+Qx5gQ==", "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.27.4", - "@jest/get-type": "30.1.0", - "@jest/pattern": "30.4.0", - "@jest/test-sequencer": "30.4.1", - "@jest/types": "30.4.1", - "babel-jest": "30.4.1", + "@jest/get-type": "30.5.0", + "@jest/pattern": "30.5.0", + "@jest/test-sequencer": "30.5.1", + "@jest/types": "30.5.1", + "babel-jest": "30.5.1", "chalk": "^4.1.2", "ci-info": "^4.2.0", "deepmerge": "^4.3.1", - "glob": "^10.5.0", + "glob": "^13.0.6", "graceful-fs": "^4.2.11", - "jest-circus": "30.4.2", - "jest-docblock": "30.4.0", - "jest-environment-node": "30.4.1", - "jest-regex-util": "30.4.0", - "jest-resolve": "30.4.1", - "jest-runner": "30.4.2", - "jest-util": "30.4.1", - "jest-validate": "30.4.1", + "jest-circus": "30.5.1", + "jest-docblock": "30.5.0", + "jest-environment-node": "30.5.1", + "jest-regex-util": "30.5.0", + "jest-resolve": "30.5.1", + "jest-runner": "30.5.1", + "jest-util": "30.5.1", + "jest-validate": "30.5.1", "parse-json": "^5.2.0", - "pretty-format": "30.4.1", + "pretty-format": "30.5.1", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, @@ -4531,25 +4991,25 @@ } }, "node_modules/jest-diff": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.4.1.tgz", - "integrity": "sha512-CRpFK0RtLriVDGcPPAnR6HMVI8bSR2jnUIgralhauzYQZIb4RH9AtEInTuQr65LmmGggGcRT6HIASxwqsVsmlA==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.5.1.tgz", + "integrity": "sha512-e3cNNMpv8Kh20MjjphTXs+3Vz7DQyLM1nft7KJhnh46atFhjVJRa+0Hq0beywuwsACtMQUBihQkFl8zxb7gt1Q==", "dev": true, "license": "MIT", "dependencies": { - "@jest/diff-sequences": "30.4.0", - "@jest/get-type": "30.1.0", + "@jest/diff-sequences": "30.5.0", + "@jest/get-type": "30.5.0", "chalk": "^4.1.2", - "pretty-format": "30.4.1" + "pretty-format": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-docblock": { - "version": "30.4.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-30.4.0.tgz", - "integrity": "sha512-ZPMabUZCx5MpbZ2eBYSvZ0J8fvo3dR9oM+eeUpb3aKNQFuS2tu3Duw1TNlMoP8k3WQgKGJuhcMFvwcVuq6T7oA==", + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-30.5.0.tgz", + "integrity": "sha512-NwDqcxtoZi33RhuW+zJS/RVA3rmheQ8BnwpYZuc/Eruaz6seQb7+aoCeDZu/3X7W2XmD8DbSo9Pn72DbKsBFYw==", "dev": true, "license": "MIT", "dependencies": { @@ -4560,111 +5020,109 @@ } }, "node_modules/jest-each": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.4.1.tgz", - "integrity": "sha512-/8MJbH6fuj48TstjrMf+u/pd06Qezz5xOXvZA6442heNOWr8bdeoGZX2d9fCn028CoMgYmroH9//zky5GfyYmA==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.5.1.tgz", + "integrity": "sha512-S1af0TU4v1EZ/AUlkFs/sxf/5KGsbAT9kRgdyoMX/x72y7C8ZEgETE5o1TPnbKRnrbprc5FR/moYLfdRmqEjsQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/get-type": "30.1.0", - "@jest/types": "30.4.1", + "@jest/get-type": "30.5.0", + "@jest/types": "30.5.1", "chalk": "^4.1.2", - "jest-util": "30.4.1", - "pretty-format": "30.4.1" + "jest-util": "30.5.1", + "pretty-format": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-environment-node": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.4.1.tgz", - "integrity": "sha512-4FZYVOk85hz2AyT6BbarKy9u37g6DbrDyCdFhsnDdXqyrueYQvB+0zO4f/kqLCRD0BsPRXPMNJeQwihKZV8naw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.5.1.tgz", + "integrity": "sha512-LrPj3sPMjsQoOB3jrb8p/sa+XkSFNKo60TTsyc+EB2kxQJHgbwElpXnx1yX25fdFn5958FIObRtcLSHyV8VIAw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "30.4.1", - "@jest/fake-timers": "30.4.1", - "@jest/types": "30.4.1", + "@jest/environment": "30.5.1", + "@jest/fake-timers": "30.5.1", + "@jest/types": "30.5.1", "@types/node": "*", - "jest-mock": "30.4.1", - "jest-util": "30.4.1", - "jest-validate": "30.4.1" + "jest-mock": "30.5.1", + "jest-util": "30.5.1", + "jest-validate": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-haste-map": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.4.1.tgz", - "integrity": "sha512-rFrcONd8jeFsyw+Z9CrScJgglRf2+NFmNam8dKu7n+SoHqNYT47mn0DdEcVUZJpvh7Iz6/si7f7yUH7GJHVgnw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.5.1.tgz", + "integrity": "sha512-VIFgt67jW480YDxKfEv9IYQKrFpYt7bOCMn3VsnjK7AK9qo7p6acpnA1DHwsVOULE3dTaYew/6JaTD/d0VDHoQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.4.1", + "@jest/types": "30.5.1", + "@parcel/watcher": "^2.6.0", "@types/node": "*", "anymatch": "^3.1.3", "fb-watchman": "^2.0.2", + "fdir": "^6.5.0", "graceful-fs": "^4.2.11", - "jest-regex-util": "30.4.0", - "jest-util": "30.4.1", - "jest-worker": "30.4.1", - "picomatch": "^4.0.3", - "walker": "^1.0.8" + "jest-regex-util": "30.5.0", + "jest-util": "30.5.1", + "jest-worker": "30.5.1", + "picomatch": "^4.0.3" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" - }, - "optionalDependencies": { - "fsevents": "^2.3.3" } }, "node_modules/jest-leak-detector": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-30.4.1.tgz", - "integrity": "sha512-IpmyiioeHxiWDhesHnUFmOxcTzwCwKpgACgWajtAP+nYQXiY7DakTxB6Bx9JFiRMljr0AX1PvnQdaU1KFoz6NQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-30.5.1.tgz", + "integrity": "sha512-gt4GT2aWgEoCNTcBe4rqS74xTIUJxi+UD9SNSu9aOk5LmTEd6fS5KSTmAKAfitCCktQHNN+upUuL6EkBfFbMDQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/get-type": "30.1.0", - "pretty-format": "30.4.1" + "@jest/get-type": "30.5.0", + "pretty-format": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-matcher-utils": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.4.1.tgz", - "integrity": "sha512-zvYfX5CaeEkFrrLS9suWe9rvJrm9J1Iv3ua8kIBv9GEPzcnsfBf0bob37la7s67fs0nlBC3EuvkOLnXQKxtx4A==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.5.1.tgz", + "integrity": "sha512-aroZVqwOz/wC2y6pC+obgFWKV9viaQWQTTSB6W5H55+egtUczIfXR/rxExTv92xD/ADYwpqaYfVWx1aqwKg7FA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/get-type": "30.1.0", + "@jest/get-type": "30.5.0", "chalk": "^4.1.2", - "jest-diff": "30.4.1", - "pretty-format": "30.4.1" + "jest-diff": "30.5.1", + "pretty-format": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-message-util": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.4.1.tgz", - "integrity": "sha512-kwCKIvq0MCW1HzLoGola9Te6JUdzgV0loyKJ3Qghrkz9i5/RRIHsL95BMQc2HBBhlBKC4j22K9p11TGHH8RBpQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.5.1.tgz", + "integrity": "sha512-UdQlLdd9wL/Ys7xRErckqwD6wPlSZYueosSWuHc1r2ztGLwlgPvtSJq2+BPEgaEY13WLvfFbmhTj8pba0Sd1jg==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.27.1", - "@jest/types": "30.4.1", + "@jest/types": "30.5.1", "@types/stack-utils": "^2.0.3", "chalk": "^4.1.2", "graceful-fs": "^4.2.11", - "jest-util": "30.4.1", + "jest-util": "30.5.1", "picomatch": "^4.0.3", - "pretty-format": "30.4.1", + "pretty-format": "30.5.1", "slash": "^3.0.0", "stack-utils": "^2.0.6" }, @@ -4673,42 +5131,25 @@ } }, "node_modules/jest-mock": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.4.1.tgz", - "integrity": "sha512-/i8SVb8/NSB7RfNi8gfqu8gxLV23KaL5EpAttyb9iz8qWRIqXRLflycz/32wXsYkOnaUlx8NAKnJYtpsmXUmfw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.5.1.tgz", + "integrity": "sha512-9fVjc3leUpGID2/by/LU4Dvdcp7PFh9LlxS3QRWK3ABm+KtvEVsG/AEGeLY3gKOZsjkBxyfwGltoAVlW7dygHg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.4.1", + "@jest/expect-utils": "30.5.1", + "@jest/types": "30.5.1", "@types/node": "*", - "jest-util": "30.4.1" + "jest-util": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/jest-pnp-resolver": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", - "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - }, - "peerDependencies": { - "jest-resolve": "*" - }, - "peerDependenciesMeta": { - "jest-resolve": { - "optional": true - } - } - }, "node_modules/jest-regex-util": { - "version": "30.4.0", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-30.4.0.tgz", - "integrity": "sha512-mWlvLviKIgIQ8VCuM1xRdD0TWp3zlzionlmDBjuXVBs+VkmXq6FgW9T4Emr7oGz/Rk6feDCGyiugolcQEyp3mg==", + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-30.5.0.tgz", + "integrity": "sha512-Mg0WK7A6xRHLSA1udJ8y9f3lM0uUhFTBnLKzwPmqB9AylvpleJ6BLemR8K9dK27DY+cesDryoA7yLZCAHsPG1A==", "dev": true, "license": "MIT", "engines": { @@ -4716,100 +5157,100 @@ } }, "node_modules/jest-resolve": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-30.4.1.tgz", - "integrity": "sha512-Zry8Yq/yJcNAZ7dJ5F2heic8AheXvbFZ7XI5V+h28nrYZ7Qoyy4dItq8OodjnYD270mvX+ZudmrNV9cysqhW5Q==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-30.5.1.tgz", + "integrity": "sha512-wprhLejRtwN6h8ZgaqC0eYjGJ1uMdGPT/+b3eFncbG4NWuuP9QL+vWwRinu9waw7hkOLcpMJGVJAMgBwsPssMQ==", "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.1.2", "graceful-fs": "^4.2.11", - "jest-haste-map": "30.4.1", - "jest-pnp-resolver": "^1.2.3", - "jest-util": "30.4.1", - "jest-validate": "30.4.1", + "jest-haste-map": "30.5.1", + "jest-util": "30.5.1", + "jest-validate": "30.5.1", "slash": "^3.0.0", - "unrs-resolver": "^1.7.11" + "unrs-resolver": "^1.12.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-resolve-dependencies": { - "version": "30.4.2", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.4.2.tgz", - "integrity": "sha512-gDiVh1I+GxYzz9oXlyw+1wv6VOYX1WYxMOfjsA3iGKePV2oxmbHhwxfkALxNxYy1ciw6APWwkW2zZONwP97aEQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.5.1.tgz", + "integrity": "sha512-JKpXGONDcTaunrNVn8KCl6qAnwl06jIkvv70lhq0Ze47lsPx9sH5HoeEUiXX6iFGnliHN/qpIbQ0l38wrVmXaw==", "dev": true, "license": "MIT", "dependencies": { - "jest-regex-util": "30.4.0", - "jest-snapshot": "30.4.1" + "jest-regex-util": "30.5.0", + "jest-snapshot": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-runner": { - "version": "30.4.2", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.4.2.tgz", - "integrity": "sha512-2dw0PslVYXxffXGpLo+Ejad+KcI1Qkjn7f4X4619gf21oCUmL+SPfjqIa/losUem3yEOvfNZe/F1HWUcNpODcg==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.5.1.tgz", + "integrity": "sha512-FPlQE4+mwnFxXmpPrSi836KV2ZzvK1g6/nPCT8o5BcoDUUNJQeHo1/Qdkoe/QeoL4M7OeJpbnGUhYKhC1VMdaQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "30.4.1", - "@jest/environment": "30.4.1", - "@jest/test-result": "30.4.1", - "@jest/transform": "30.4.1", - "@jest/types": "30.4.1", + "@jest/console": "30.5.1", + "@jest/environment": "30.5.1", + "@jest/source-map": "30.5.0", + "@jest/test-result": "30.5.1", + "@jest/transform": "30.5.1", + "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", "emittery": "^0.13.1", "exit-x": "^0.2.2", "graceful-fs": "^4.2.11", - "jest-docblock": "30.4.0", - "jest-environment-node": "30.4.1", - "jest-haste-map": "30.4.1", - "jest-leak-detector": "30.4.1", - "jest-message-util": "30.4.1", - "jest-resolve": "30.4.1", - "jest-runtime": "30.4.2", - "jest-util": "30.4.1", - "jest-watcher": "30.4.1", - "jest-worker": "30.4.1", - "p-limit": "^3.1.0", - "source-map-support": "0.5.13" + "jest-docblock": "30.5.0", + "jest-environment-node": "30.5.1", + "jest-haste-map": "30.5.1", + "jest-leak-detector": "30.5.1", + "jest-message-util": "30.5.1", + "jest-resolve": "30.5.1", + "jest-runtime": "30.5.1", + "jest-util": "30.5.1", + "jest-watcher": "30.5.1", + "jest-worker": "30.5.1", + "p-limit": "^3.1.0" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-runtime": { - "version": "30.4.2", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.4.2.tgz", - "integrity": "sha512-3/5e8iPz2k/VLqlr8DgTftYyLUv8Su3FkCAO2/Od81UsUTpSxOrS6O5x5KkoQwyUjmpYyDJKeyAvg2T2nvpNkQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.5.1.tgz", + "integrity": "sha512-UB88+NRkK2Tw/OqV7dofYcyiUGrVZtD41k/N0xQOs9fG//57XHK7JLWG52HD1UYpUAhjK4xm6DBvFX3yWudsMA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "30.4.1", - "@jest/fake-timers": "30.4.1", - "@jest/globals": "30.4.1", - "@jest/source-map": "30.0.1", - "@jest/test-result": "30.4.1", - "@jest/transform": "30.4.1", - "@jest/types": "30.4.1", + "@jest/environment": "30.5.1", + "@jest/fake-timers": "30.5.1", + "@jest/globals": "30.5.1", + "@jest/source-map": "30.5.0", + "@jest/test-result": "30.5.1", + "@jest/transform": "30.5.1", + "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", - "cjs-module-lexer": "^2.1.0", + "cjs-module-lexer": "^2.2.0", "collect-v8-coverage": "^1.0.2", - "glob": "^10.5.0", + "es-module-lexer": "^2.1.0", + "glob": "^13.0.6", "graceful-fs": "^4.2.11", - "jest-haste-map": "30.4.1", - "jest-message-util": "30.4.1", - "jest-mock": "30.4.1", - "jest-regex-util": "30.4.0", - "jest-resolve": "30.4.1", - "jest-snapshot": "30.4.1", - "jest-util": "30.4.1", + "jest-haste-map": "30.5.1", + "jest-message-util": "30.5.1", + "jest-mock": "30.5.1", + "jest-regex-util": "30.5.0", + "jest-resolve": "30.5.1", + "jest-snapshot": "30.5.1", + "jest-util": "30.5.1", "slash": "^3.0.0", "strip-bom": "^4.0.0" }, @@ -4818,9 +5259,9 @@ } }, "node_modules/jest-snapshot": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.4.1.tgz", - "integrity": "sha512-tEOkkfOMppUyeiHwjZswOQ3lcnoTnws/q5FnGIaeIh/jmoU0ZlgMYRR8sTlTj+nNGCoJ0RDq6SfxGxCsyMTPmw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.5.1.tgz", + "integrity": "sha512-cNWFdSb5xuDGl8hKkAZJ3YtI/PzHpAPFV+HUXWIOG8rMhpDTLVbvAc2d2wRicoYw2wGsJGLaurJT6BLC97bLXQ==", "dev": true, "license": "MIT", "dependencies": { @@ -4829,20 +5270,20 @@ "@babel/plugin-syntax-jsx": "^7.27.1", "@babel/plugin-syntax-typescript": "^7.27.1", "@babel/types": "^7.27.3", - "@jest/expect-utils": "30.4.1", - "@jest/get-type": "30.1.0", - "@jest/snapshot-utils": "30.4.1", - "@jest/transform": "30.4.1", - "@jest/types": "30.4.1", + "@jest/expect-utils": "30.5.1", + "@jest/get-type": "30.5.0", + "@jest/snapshot-utils": "30.5.1", + "@jest/transform": "30.5.1", + "@jest/types": "30.5.1", "babel-preset-current-node-syntax": "^1.2.0", "chalk": "^4.1.2", - "expect": "30.4.1", + "expect": "30.5.1", "graceful-fs": "^4.2.11", - "jest-diff": "30.4.1", - "jest-matcher-utils": "30.4.1", - "jest-message-util": "30.4.1", - "jest-util": "30.4.1", - "pretty-format": "30.4.1", + "jest-diff": "30.5.1", + "jest-matcher-utils": "30.5.1", + "jest-message-util": "30.5.1", + "jest-util": "30.5.1", + "pretty-format": "30.5.1", "semver": "^7.7.2", "synckit": "^0.11.8" }, @@ -4864,13 +5305,13 @@ } }, "node_modules/jest-util": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.4.1.tgz", - "integrity": "sha512-vjQb1sACEiv13DKJMDToJpzVW0joCsIQrmbg0fi7CyOOt+g9jTuQl2A216pWRBYhOVt53XbL/2LbMKg1BECWOw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.5.1.tgz", + "integrity": "sha512-yKuxmNy2rSbTXw+3SIPanJo+nV4/BS1p26v44IYBFMsswSQySfMMcPHErnOncda7i9HEz0q605rIhSTBVgrZTg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "30.4.1", + "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", "ci-info": "^4.2.0", @@ -4882,18 +5323,18 @@ } }, "node_modules/jest-validate": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.4.1.tgz", - "integrity": "sha512-PDWi4SOwLnwqNDfHZjOcsEFyZ4fc/2W2gVL3DEoyqnB6jCQMLRtfBong8s6omIw3lI0HWOus12xfnFmQtjW3fw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.5.1.tgz", + "integrity": "sha512-i/buJ56wTpxihE93hQYNMfdOThS87+HGvLZzZJmU4xggPcdTYQq051iwALLCHp3q+SkCGH+EFejQZz5EbBSkkg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/get-type": "30.1.0", - "@jest/types": "30.4.1", + "@jest/get-type": "30.5.0", + "@jest/types": "30.5.1", "camelcase": "^6.3.0", "chalk": "^4.1.2", "leven": "^3.1.0", - "pretty-format": "30.4.1" + "pretty-format": "30.5.1" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" @@ -4913,19 +5354,19 @@ } }, "node_modules/jest-watcher": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.4.1.tgz", - "integrity": "sha512-/l9UonmvCwjHH7d2h3iAwIloLc1H0S8mJZ/LNK3i86hqwPAz8otUJjP9MfYtz9Tt77Su5FD2xGjZn8d31IZHlw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.5.1.tgz", + "integrity": "sha512-+FHJ7C+S7b3ySfhA1aFmoa6TztsnwZVv84ycPRn0tVN93np2EU4b8C/KadqA3l6igdjgLBTnUotab9ER0HLG8A==", "dev": true, "license": "MIT", "dependencies": { - "@jest/test-result": "30.4.1", - "@jest/types": "30.4.1", + "@jest/test-result": "30.5.1", + "@jest/types": "30.5.1", "@types/node": "*", "ansi-escapes": "^4.3.2", "chalk": "^4.1.2", "emittery": "^0.13.1", - "jest-util": "30.4.1", + "jest-util": "30.5.1", "string-length": "^4.0.2" }, "engines": { @@ -4933,15 +5374,15 @@ } }, "node_modules/jest-worker": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-30.4.1.tgz", - "integrity": "sha512-SHynN/q/QD++iNyvMdy+WMmbCGk8jIsNcRxycXbWubSOhvo6T+j2afcfUSl+3hYsiBebOTo0cT7c2H7CXugu1g==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-30.5.1.tgz", + "integrity": "sha512-Cbxh5v7AoLuFRmFJSM4/aHdQ68rjXvUWr716EE0Dh3I7T+T/3FgFKhOERGXHcU2Meftq9+9zxPM3TSNyI9D+HA==", "dev": true, "license": "MIT", "dependencies": { "@types/node": "*", "@ungap/structured-clone": "^1.3.0", - "jest-util": "30.4.1", + "jest-util": "30.5.1", "merge-stream": "^2.0.0", "supports-color": "^8.1.1" }, @@ -4983,9 +5424,9 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz", - "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz", + "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==", "dev": true, "funding": [ { @@ -5027,13 +5468,6 @@ "bignumber.js": "^9.0.0" } }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true, - "license": "MIT" - }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -5069,13 +5503,13 @@ } }, "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.6.0.tgz", + "integrity": "sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw==", "dev": true, "license": "MIT", "dependencies": { - "json-buffer": "3.0.1" + "@keyv/serialize": "^1.1.1" } }, "node_modules/leven": { @@ -5197,16 +5631,6 @@ "node": ">=10" } }, - "node_modules/makeerror": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", - "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "tmpl": "1.0.5" - } - }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -5305,6 +5729,13 @@ "dev": true, "license": "MIT" }, + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "dev": true, + "license": "MIT" + }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -5313,9 +5744,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.53", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.53.tgz", - "integrity": "sha512-D9UOmYG3UH1V+ENW56t5QXBwJw1YEY18ruVeus89Rw+SyIgjPkCO84bRzO3uNIYosJbNwiabWVn48o3uJLjxFQ==", + "version": "2.0.55", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.55.tgz", + "integrity": "sha512-mIrE/Cw9y+9Au6dS5vDKDhQza9YvG6w+ZrS6X+ZzA7yFW/soAeaups4Qzn1bL6g5FVy8WtP79+0j82oPIbqRjQ==", "dev": true, "license": "MIT", "engines": { @@ -5355,16 +5786,6 @@ "node": ">=0.10.0" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, "node_modules/onetime": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", @@ -5477,16 +5898,6 @@ "node": ">=8" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -5498,28 +5909,31 @@ } }, "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" }, "engines": { - "node": ">=16 || 14 >=14.18" + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "version": "11.5.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz", + "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==", "dev": true, - "license": "ISC" + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } }, "node_modules/pathe": { "version": "2.0.3", @@ -5709,16 +6123,16 @@ } }, "node_modules/pretty-format": { - "version": "30.4.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.4.1.tgz", - "integrity": "sha512-K6KiKMHTL4jjX4u3Kir2EW07nRfcqVTXIImx50wbjHQTcZPgg+gjVeNTIT3l3L1Rd4UefxfogquC9J37SoFyyw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.5.1.tgz", + "integrity": "sha512-byhRAPguVKMQIj4kjJwJ5lAskVhfuiSdiYl/aLTWpgkGEmic2jYhJh1yE9ih8Ox44Xg9ccCT11/S6QrzSJuNrg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/schemas": "30.4.1", - "ansi-styles": "^5.2.0", - "react-is-18": "npm:react-is@^18.3.1", - "react-is-19": "npm:react-is@^19.2.5" + "@jest/react-is-18": "npm:react-is@^18.3.1", + "@jest/react-is-19": "npm:react-is@^19.2.5", + "@jest/schemas": "30.5.0", + "ansi-styles": "^5.2.0" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" @@ -5764,19 +6178,23 @@ ], "license": "MIT" }, - "node_modules/react-is-18": { - "name": "react-is", - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "node_modules/qified": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/qified/-/qified-0.10.1.tgz", + "integrity": "sha512-+Owyggi9IxT1ePKGafcI87ubSmxol6smwJ+RAHDQlx9+9cPwFWDiKFFCPuWhr9ignlGpZ9vDQLw67N4dcTVFEA==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "hookified": "^2.1.1" + }, + "engines": { + "node": ">=20" + } }, - "node_modules/react-is-19": { - "name": "react-is", - "version": "19.2.8", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.8.tgz", - "integrity": "sha512-s5un28nYxKJw5gvUHyW5PCC28CvBqLu9r3cWgzHT4Vo/5fqqkFcdRYsGcKf50WMPpjjFZS5d76fn3YCo2njKwQ==", + "node_modules/qified/node_modules/hookified": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/hookified/-/hookified-2.2.0.tgz", + "integrity": "sha512-p/LgFzRN5FeoD3DLS6bkUapeye6E4SI6yJs6KetENd18S+FBthqYq2amJUWpt5z0EQwwHemidjY5OqJGEKm5uA==", "dev": true, "license": "MIT" }, @@ -5828,9 +6246,9 @@ } }, "node_modules/rollup": { - "version": "4.62.5", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.5.tgz", - "integrity": "sha512-/tqMfgP7GPA3PHhCmuiS4vIjrSVhHLgY++i+dhbG462euyAj7FpM4D9uq1X3BgjlqRdpcOrYhcQtfiQLNc8tqw==", + "version": "4.63.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.63.3.tgz", + "integrity": "sha512-1i2XreiAoMMXuPGD6Msj2xWrMMkHojNRKivInxGQcg7/1KuPuYlfUutLyh4drnOxUTHX9cHI4wFoat8D/NKaBw==", "dev": true, "license": "MIT", "dependencies": { @@ -5845,31 +6263,31 @@ }, "optionalDependencies": { "@napi-rs/lzma-linux-x64-gnu": "1.5.1", - "@rollup/rollup-android-arm-eabi": "4.62.5", - "@rollup/rollup-android-arm64": "4.62.5", - "@rollup/rollup-darwin-arm64": "4.62.5", - "@rollup/rollup-darwin-x64": "4.62.5", - "@rollup/rollup-freebsd-arm64": "4.62.5", - "@rollup/rollup-freebsd-x64": "4.62.5", - "@rollup/rollup-linux-arm-gnueabihf": "4.62.5", - "@rollup/rollup-linux-arm-musleabihf": "4.62.5", - "@rollup/rollup-linux-arm64-gnu": "4.62.5", - "@rollup/rollup-linux-arm64-musl": "4.62.5", - "@rollup/rollup-linux-loong64-gnu": "4.62.5", - "@rollup/rollup-linux-loong64-musl": "4.62.5", - "@rollup/rollup-linux-ppc64-gnu": "4.62.5", - "@rollup/rollup-linux-ppc64-musl": "4.62.5", - "@rollup/rollup-linux-riscv64-gnu": "4.62.5", - "@rollup/rollup-linux-riscv64-musl": "4.62.5", - "@rollup/rollup-linux-s390x-gnu": "4.62.5", - "@rollup/rollup-linux-x64-gnu": "4.62.5", - "@rollup/rollup-linux-x64-musl": "4.62.5", - "@rollup/rollup-openbsd-x64": "4.62.5", - "@rollup/rollup-openharmony-arm64": "4.62.5", - "@rollup/rollup-win32-arm64-msvc": "4.62.5", - "@rollup/rollup-win32-ia32-msvc": "4.62.5", - "@rollup/rollup-win32-x64-gnu": "4.62.5", - "@rollup/rollup-win32-x64-msvc": "4.62.5", + "@rollup/rollup-android-arm-eabi": "4.63.3", + "@rollup/rollup-android-arm64": "4.63.3", + "@rollup/rollup-darwin-arm64": "4.63.3", + "@rollup/rollup-darwin-x64": "4.63.3", + "@rollup/rollup-freebsd-arm64": "4.63.3", + "@rollup/rollup-freebsd-x64": "4.63.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.63.3", + "@rollup/rollup-linux-arm-musleabihf": "4.63.3", + "@rollup/rollup-linux-arm64-gnu": "4.63.3", + "@rollup/rollup-linux-arm64-musl": "4.63.3", + "@rollup/rollup-linux-loong64-gnu": "4.63.3", + "@rollup/rollup-linux-loong64-musl": "4.63.3", + "@rollup/rollup-linux-ppc64-gnu": "4.63.3", + "@rollup/rollup-linux-ppc64-musl": "4.63.3", + "@rollup/rollup-linux-riscv64-gnu": "4.63.3", + "@rollup/rollup-linux-riscv64-musl": "4.63.3", + "@rollup/rollup-linux-s390x-gnu": "4.63.3", + "@rollup/rollup-linux-x64-gnu": "4.63.3", + "@rollup/rollup-linux-x64-musl": "4.63.3", + "@rollup/rollup-openbsd-x64": "4.63.3", + "@rollup/rollup-openharmony-arm64": "4.63.3", + "@rollup/rollup-win32-arm64-msvc": "4.63.3", + "@rollup/rollup-win32-ia32-msvc": "4.63.3", + "@rollup/rollup-win32-x64-gnu": "4.63.3", + "@rollup/rollup-win32-x64-msvc": "4.63.3", "fsevents": "~2.3.2" } }, @@ -5907,17 +6325,11 @@ } }, "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true, - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } + "license": "ISC" }, "node_modules/slash": { "version": "3.0.0", @@ -5930,24 +6342,13 @@ } }, "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", + "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", "dev": true, "license": "BSD-3-Clause", "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", - "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "node": ">= 12" } }, "node_modules/stack-utils": { @@ -5987,47 +6388,21 @@ "node": ">=10" } }, - "node_modules/string-length/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/string-length/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "license": "MIT", "dependencies": { - "ansi-regex": "^5.0.1" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, - "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/string-width-cjs": { "name": "string-width", "version": "4.2.3", @@ -6044,24 +6419,7 @@ "node": ">=8" } }, - "node_modules/string-width-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/string-width-cjs/node_modules/strip-ansi": { + "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", @@ -6074,22 +6432,6 @@ "node": ">=8" } }, - "node_modules/strip-ansi": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", - "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.2.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/strip-ansi-cjs": { "name": "strip-ansi", "version": "6.0.1", @@ -6104,16 +6446,6 @@ "node": ">=8" } }, - "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -6200,53 +6532,80 @@ } }, "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.2.tgz", + "integrity": "sha512-u9E6A+ZDYdp7a4WnarkXPZOx8Ilz46+kby6p1yZ8zsGTz9gYa6FIS7lj2oezzNKmtdyyJNNmmXDppga5GB7kSw==", "dev": true, "license": "ISC", "dependencies": { "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" + "glob": "^10.4.1", + "minimatch": "^10.2.2" }, "engines": { - "node": ">=8" + "node": ">=18" } }, "node_modules/test-exclude/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dev": true, "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, - "engines": { - "node": "*" + "bin": { + "glob": "dist/esm/bin.mjs" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/test-exclude/node_modules/minimatch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", - "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "node_modules/test-exclude/node_modules/glob/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dev": true, "license": "ISC", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.2" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/test-exclude/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/thenify": { @@ -6296,13 +6655,6 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, - "node_modules/tmpl": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", - "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", - "dev": true, - "license": "BSD-3-Clause" - }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", @@ -6393,16 +6745,6 @@ } } }, - "node_modules/tsup/node_modules/source-map": { - "version": "0.7.6", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", - "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">= 12" - } - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -6454,16 +6796,16 @@ } }, "node_modules/typescript-eslint": { - "version": "8.67.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.67.0.tgz", - "integrity": "sha512-S2udFs8tCKEKffuJ4TB1idGUZiXdCPGi3IPBGWXarbLQ5UPXORV8QEVzJ4gCRduURMb5EkpNCdjbk0eDIuI8Yg==", + "version": "8.70.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.70.0.tgz", + "integrity": "sha512-P/W5cz70/cQAuKfY3xwQMWWTV7BvJ0mAQmi+9mBcsVPaBUpd6Ohpa+fECv9rBFrQcig86jAiNBFNWUqnTjr4pw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.67.0", - "@typescript-eslint/parser": "8.67.0", - "@typescript-eslint/typescript-estree": "8.67.0", - "@typescript-eslint/utils": "8.67.0" + "@typescript-eslint/eslint-plugin": "8.70.0", + "@typescript-eslint/parser": "8.70.0", + "@typescript-eslint/typescript-estree": "8.70.0", + "@typescript-eslint/utils": "8.70.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -6485,18 +6827,18 @@ "license": "MIT" }, "node_modules/undici": { - "version": "6.28.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.28.0.tgz", - "integrity": "sha512-LIY910g9TI13YS95lrMFrs8Rm/u/irgHeTWoKCoteeJ04CUJ92eEfj0rVn+7VKMPBpUPiUoBKfhNyLI23EE/KA==", + "version": "6.28.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.28.1.tgz", + "integrity": "sha512-zWpdTVD54H48CIybL0rWQ3ukpb9d23wM7eH5RtfdmeP70cWHNjtfo7P4vZX+5CoDcO53J4Pu5uXp7lNfjc6DRA==", "license": "MIT", "engines": { "node": ">=18.17" } }, "node_modules/undici-types": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", - "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", "dev": true, "license": "MIT" }, @@ -6539,9 +6881,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.1.tgz", - "integrity": "sha512-ZZ61DsRsOnakl74HAmp3oSN4aXUmEWXf+i/yv0h7tIBfICc3VdrFErQKUUKPgu3AMsTUMbcongALEN4l6GSUrQ==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", + "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==", "dev": true, "funding": [ { @@ -6594,16 +6936,6 @@ "node": ">=10.12.0" } }, - "node_modules/walker": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", - "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "makeerror": "1.0.12" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -6631,18 +6963,18 @@ } }, "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=12" + "node": ">=10" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" @@ -6667,71 +6999,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "license": "ISC" - }, "node_modules/write-file-atomic": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", @@ -6746,6 +7013,19 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/write-file-atomic/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -6792,51 +7072,6 @@ "node": ">=12" } }, - "node_modules/yargs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/yargs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index 1fd513ca..4c31325e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "29.0.0", + "version": "30.0.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", @@ -48,15 +48,15 @@ }, "devDependencies": { "@eslint/js": "10.0.1", - "eslint": "10.9.0", + "eslint": "10.10.0", "globals": "16.5.0", "@types/json-bigint": "1.0.4", - "@types/node": "26.2.0", + "@types/node": "26.5.1", "tsup": "^8.5.1", "esbuild-plugin-file-path-extensions": "^2.0.0", "tslib": "2.8.1", "typescript": "5.9.3", - "typescript-eslint": "8.67.0", + "typescript-eslint": "8.70.0", "jest": "^30.4.2", "prettier": "3.9.6" }, diff --git a/src/client.ts b/src/client.ts index 10ff7294..da821dd3 100644 --- a/src/client.ts +++ b/src/client.ts @@ -80,7 +80,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/29.0.0'; + let ua = 'AppwriteNodeJSSDK/30.0.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -132,7 +132,6 @@ class Client { locale: '', session: '', forwardeduseragent: '', - devkey: '', cookie: '', impersonateuserid: '', impersonateuseremail: '', @@ -142,9 +141,9 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '29.0.0', + 'x-sdk-version': '30.0.0', 'user-agent': getUserAgent(), - 'X-Appwrite-Response-Format': '2.0.0', + 'X-Appwrite-Response-Format': '2.3.0', }; /** @@ -330,20 +329,6 @@ class Client { this.config.forwardeduseragent = value; return this; } - /** - * Set DevKey - * - * Your secret dev API key - * - * @param value string - * - * @return {this} - */ - setDevKey(value: string): this { - this.headers['X-Appwrite-Dev-Key'] = value; - this.config.devkey = value; - return this; - } /** * Set Cookie * diff --git a/src/enums/billing-plan-group.ts b/src/enums/billing-plan-group.ts index e8cd15d8..fd8da3ae 100644 --- a/src/enums/billing-plan-group.ts +++ b/src/enums/billing-plan-group.ts @@ -1,5 +1,6 @@ export enum BillingPlanGroup { - Starter = 'starter', + Free = 'free', + Start = 'start', Pro = 'pro', Scale = 'scale', } diff --git a/src/enums/build-runtime.ts b/src/enums/build-runtime.ts index cad34c11..2dfd9c61 100644 --- a/src/enums/build-runtime.ts +++ b/src/enums/build-runtime.ts @@ -50,6 +50,7 @@ export enum BuildRuntime { Dart310 = 'dart-3.10', Dart311 = 'dart-3.11', Dart312 = 'dart-3.12', + Dart313 = 'dart-3.13', Dotnet60 = 'dotnet-6.0', Dotnet70 = 'dotnet-7.0', Dotnet80 = 'dotnet-8.0', @@ -92,4 +93,5 @@ export enum BuildRuntime { Flutter338 = 'flutter-3.38', Flutter341 = 'flutter-3.41', Flutter344 = 'flutter-3.44', + Flutter347 = 'flutter-3.47', } diff --git a/src/enums/domain-registration-type.ts b/src/enums/domain-registration-type.ts new file mode 100644 index 00000000..4ef7f07a --- /dev/null +++ b/src/enums/domain-registration-type.ts @@ -0,0 +1,6 @@ +export enum DomainRegistrationType { + New = 'new', + Transfer = 'transfer', + Renewal = 'renewal', + Trade = 'trade', +} diff --git a/src/enums/domain-transfer-status-enum.ts b/src/enums/domain-transfer-status-enum.ts new file mode 100644 index 00000000..a9dbdd89 --- /dev/null +++ b/src/enums/domain-transfer-status-enum.ts @@ -0,0 +1,10 @@ +export enum DomainTransferStatusEnum { + Transferrable = 'transferrable', + NotTransferrable = 'not_transferrable', + PendingOwner = 'pending_owner', + PendingAdmin = 'pending_admin', + PendingRegistry = 'pending_registry', + Completed = 'completed', + Cancelled = 'cancelled', + ServiceUnavailable = 'service_unavailable', +} diff --git a/src/enums/framework.ts b/src/enums/framework.ts index 6173a0ef..65f4a87e 100644 --- a/src/enums/framework.ts +++ b/src/enums/framework.ts @@ -11,6 +11,7 @@ export enum Framework { Remix = 'remix', Lynx = 'lynx', Flutter = 'flutter', + Jaspr = 'jaspr', Reactnative = 'react-native', Vite = 'vite', Other = 'other', diff --git a/src/enums/id-token-provider.ts b/src/enums/id-token-provider.ts new file mode 100644 index 00000000..4f99708a --- /dev/null +++ b/src/enums/id-token-provider.ts @@ -0,0 +1,4 @@ +export enum IdTokenProvider { + Apple = 'apple', + Google = 'google', +} diff --git a/src/enums/image-gravity.ts b/src/enums/image-gravity.ts index a115f3a2..7b269c31 100644 --- a/src/enums/image-gravity.ts +++ b/src/enums/image-gravity.ts @@ -1,4 +1,5 @@ export enum ImageGravity { + Auto = 'auto', Center = 'center', Topleft = 'top-left', Top = 'top', diff --git a/src/enums/o-auth-provider.ts b/src/enums/o-auth-provider.ts index 2d838dd4..92a95970 100644 --- a/src/enums/o-auth-provider.ts +++ b/src/enums/o-auth-provider.ts @@ -21,6 +21,7 @@ export enum OAuthProvider { Gitlab = 'gitlab', Google = 'google', Huggingface = 'huggingface', + Kakao = 'kakao', Keycloak = 'keycloak', Kick = 'kick', Linkedin = 'linkedin', @@ -36,6 +37,7 @@ export enum OAuthProvider { Slack = 'slack', Spotify = 'spotify', Stripe = 'stripe', + Tiktok = 'tiktok', Tradeshift = 'tradeshift', TradeshiftBox = 'tradeshiftBox', Twitch = 'twitch', diff --git a/src/enums/organization-key-scopes.ts b/src/enums/organization-key-scopes.ts deleted file mode 100644 index 2e878b48..00000000 --- a/src/enums/organization-key-scopes.ts +++ /dev/null @@ -1,18 +0,0 @@ -export enum OrganizationKeyScopes { - ProjectsRead = 'projects.read', - ProjectsWrite = 'projects.write', - DevKeysRead = 'devKeys.read', - DevKeysWrite = 'devKeys.write', - OrganizationKeysRead = 'organization.keys.read', - OrganizationKeysWrite = 'organization.keys.write', - OrganizationInstallationsRead = 'organization.installations.read', - OrganizationInstallationsWrite = 'organization.installations.write', - OrganizationMembershipsRead = 'organization.memberships.read', - OrganizationMembershipsWrite = 'organization.memberships.write', - OrganizationRead = 'organization.read', - OrganizationWrite = 'organization.write', - DomainsRead = 'domains.read', - DomainsWrite = 'domains.write', - KeysRead = 'keys.read', - KeysWrite = 'keys.write', -} diff --git a/src/enums/project-email-template-id.ts b/src/enums/project-email-template-id.ts index c8ecbec4..be742ea3 100644 --- a/src/enums/project-email-template-id.ts +++ b/src/enums/project-email-template-id.ts @@ -6,4 +6,6 @@ export enum ProjectEmailTemplateId { MfaChallenge = 'mfaChallenge', SessionAlert = 'sessionAlert', OtpSession = 'otpSession', + OtpVerification = 'otpVerification', + OtpRecovery = 'otpRecovery', } diff --git a/src/enums/project-key-scopes.ts b/src/enums/project-key-scopes.ts index e17dffdb..d7cb41cf 100644 --- a/src/enums/project-key-scopes.ts +++ b/src/enums/project-key-scopes.ts @@ -103,6 +103,7 @@ export enum ProjectKeyScopes { ReportsWrite = 'reports.write', PresencesRead = 'presences.read', PresencesWrite = 'presences.write', + DedicatedDatabasesExecute = 'dedicatedDatabases.execute', BackupsPoliciesRead = 'backups.policies.read', BackupsPoliciesWrite = 'backups.policies.write', ArchivesRead = 'archives.read', diff --git a/src/enums/project-o-auth-provider-id.ts b/src/enums/project-o-auth-provider-id.ts index f7cd133c..3ab5db15 100644 --- a/src/enums/project-o-auth-provider-id.ts +++ b/src/enums/project-o-auth-provider-id.ts @@ -21,6 +21,7 @@ export enum ProjectOAuthProviderId { Gitlab = 'gitlab', Google = 'google', Huggingface = 'huggingface', + Kakao = 'kakao', Keycloak = 'keycloak', Kick = 'kick', Linkedin = 'linkedin', @@ -36,6 +37,7 @@ export enum ProjectOAuthProviderId { Slack = 'slack', Spotify = 'spotify', Stripe = 'stripe', + Tiktok = 'tiktok', Tradeshift = 'tradeshift', TradeshiftBox = 'tradeshiftBox', Twitch = 'twitch', diff --git a/src/enums/project-policy-id.ts b/src/enums/project-policy-id.ts index c05f7f60..d323094f 100644 --- a/src/enums/project-policy-id.ts +++ b/src/enums/project-policy-id.ts @@ -3,6 +3,7 @@ export enum ProjectPolicyId { Passwordhistory = 'password-history', Passwordstrength = 'password-strength', Passwordpersonaldata = 'password-personal-data', + Passwordpwned = 'password-pwned', Sessionalert = 'session-alert', Sessionduration = 'session-duration', Sessioninvalidation = 'session-invalidation', diff --git a/src/enums/runtime.ts b/src/enums/runtime.ts index ecc4e827..7bbcbb6f 100644 --- a/src/enums/runtime.ts +++ b/src/enums/runtime.ts @@ -50,6 +50,7 @@ export enum Runtime { Dart310 = 'dart-3.10', Dart311 = 'dart-3.11', Dart312 = 'dart-3.12', + Dart313 = 'dart-3.13', Dotnet60 = 'dotnet-6.0', Dotnet70 = 'dotnet-7.0', Dotnet80 = 'dotnet-8.0', @@ -92,4 +93,5 @@ export enum Runtime { Flutter338 = 'flutter-3.38', Flutter341 = 'flutter-3.41', Flutter344 = 'flutter-3.44', + Flutter347 = 'flutter-3.47', } diff --git a/src/index.ts b/src/index.ts index d63a2efc..9c7dfa73 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,6 +6,7 @@ export { Avatars } from './services/avatars'; export { Backups } from './services/backups'; export { Databases } from './services/databases'; export { DocumentsDB } from './services/documents-db'; +export { Domains } from './services/domains'; export { Embeddings } from './services/embeddings'; export { Functions } from './services/functions'; export { Graphql } from './services/graphql'; @@ -36,6 +37,7 @@ export { ID } from './id'; export { Operator, Condition } from './operator'; export { AuthenticatorType } from './enums/authenticator-type'; export { AuthenticationFactor } from './enums/authentication-factor'; +export { IdTokenProvider } from './enums/id-token-provider'; export { OAuthProvider } from './enums/o-auth-provider'; export { Browser } from './enums/browser'; export { CreditCard } from './enums/credit-card'; @@ -50,6 +52,7 @@ export { RelationMutate } from './enums/relation-mutate'; export { DatabasesIndexType } from './enums/databases-index-type'; export { OrderBy } from './enums/order-by'; export { DocumentsDBIndexType } from './enums/documents-db-index-type'; +export { DomainRegistrationType } from './enums/domain-registration-type'; export { EmbeddingModel } from './enums/embedding-model'; export { Runtime } from './enums/runtime'; export { ProjectKeyScopes } from './enums/project-key-scopes'; @@ -59,7 +62,6 @@ export { DeploymentDownloadType } from './enums/deployment-download-type'; export { ExecutionMethod } from './enums/execution-method'; export { MessagePriority } from './enums/message-priority'; export { SmtpEncryption } from './enums/smtp-encryption'; -export { OrganizationKeyScopes } from './enums/organization-key-scopes'; export { Region } from './enums/region'; export { ProjectAuthMethodId } from './enums/project-auth-method-id'; export { ProjectOAuth2GooglePrompt } from './enums/project-o-auth-2-google-prompt'; @@ -99,3 +101,4 @@ export { ProxyRuleDeploymentResourceType } from './enums/proxy-rule-deployment-r export { ProxyRuleStatus } from './enums/proxy-rule-status'; export { MessageStatus } from './enums/message-status'; export { BillingPlanGroup } from './enums/billing-plan-group'; +export { DomainTransferStatusEnum } from './enums/domain-transfer-status-enum'; diff --git a/src/models.ts b/src/models.ts index 408bbddc..c9a19dc4 100644 --- a/src/models.ts +++ b/src/models.ts @@ -16,6 +16,7 @@ import { ProxyRuleDeploymentResourceType } from './enums/proxy-rule-deployment-r import { ProxyRuleStatus } from './enums/proxy-rule-status'; import { MessageStatus } from './enums/message-status'; import { BillingPlanGroup } from './enums/billing-plan-group'; +import { DomainTransferStatusEnum } from './enums/domain-transfer-status-enum'; /** * Appwrite Models @@ -181,20 +182,6 @@ export namespace Models { identities: Identity[]; }; - /** - * Logs List - */ - export type LogList = { - /** - * Total number of logs that matched your query. - */ - total: number; - /** - * List of logs. - */ - logs: Log[]; - }; - /** * Files List */ @@ -507,6 +494,7 @@ export namespace Models { | Models.PolicyPasswordHistory | Models.PolicyPasswordStrength | Models.PolicyPasswordPersonalData + | Models.PolicyPasswordPwned | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation @@ -766,7 +754,7 @@ export namespace Models { */ error?: string; /** - * Container status of the dedicated backing: active or inactive. Null when the database has no dedicated backing or the runtime has not reported one. + * Container status of the dedicated backing: active, inactive, or failed (a wake was declined because the backing namespace is gone). Null when the database has no dedicated backing or the runtime has not reported one. */ containerStatus?: string; /** @@ -3071,100 +3059,6 @@ export namespace Models { metadata?: object; }; - /** - * Log - */ - export type Log = { - /** - * Event name. - */ - event: string; - /** - * User ID of the actor recorded for this log. During impersonation, this is the original impersonator, not the impersonated target user. - */ - userId: string; - /** - * User email of the actor recorded for this log. During impersonation, this is the original impersonator. - */ - userEmail: string; - /** - * User name of the actor recorded for this log. During impersonation, this is the original impersonator. - */ - userName: string; - /** - * API mode when event triggered. - */ - mode: string; - /** - * User type who triggered the audit log. Possible values: user, admin, guest, hidden, keyProject, keyAccount, keyOrganization. - */ - userType: string; - /** - * IP session in use when the session was created. - */ - ip: string; - /** - * Log creation date in ISO 8601 format. - */ - time: string; - /** - * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). - */ - osCode: string; - /** - * Operating system name. - */ - osName: string; - /** - * Operating system version. - */ - osVersion: string; - /** - * Client type. - */ - clientType: string; - /** - * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). - */ - clientCode: string; - /** - * Client name. - */ - clientName: string; - /** - * Client version. - */ - clientVersion: string; - /** - * Client engine name. - */ - clientEngine: string; - /** - * Client engine name. - */ - clientEngineVersion: string; - /** - * Device name. - */ - deviceName: string; - /** - * Device brand name. - */ - deviceBrand: string; - /** - * Device model name. - */ - deviceModel: string; - /** - * Country two-character ISO 3166-1 alpha code. - */ - countryCode: string; - /** - * Country name. - */ - countryName: string; - }; - /** * User */ @@ -3247,6 +3141,10 @@ export namespace Models { * Whether the user email is in its canonical form. */ emailIsCanonical?: boolean; + /** + * Whether the password was found in a known data breach the last time it was checked. Null when the password has never been checked. + */ + passwordPwned?: boolean; /** * Phone verification status. */ @@ -3563,6 +3461,10 @@ export namespace Models { * Identity Provider Refresh Token. */ providerRefreshToken: string; + /** + * Identity Provider ID token (JWT) from the most recent native sign-in. Empty for identities created through the browser OAuth2 flow. + */ + providerIdToken: string; }; /** @@ -4518,7 +4420,7 @@ export namespace Models { */ errors: string; /** - * Resource(function/site) execution duration in seconds. + * Total time the resource(function/site) took to respond, in seconds. */ duration: number; /** @@ -4555,10 +4457,6 @@ export namespace Models { * Project region */ region: string; - /** - * Deprecated since 1.9.5: List of dev keys. - */ - devKeys: DevKey[]; /** * Status for custom SMTP */ @@ -4647,6 +4545,14 @@ export namespace Models { * Billing limits reached */ billingLimits?: BillingLimits; + /** + * First time the project received a non-console API request. Empty until the project is used. + */ + firstAccessedAt?: string; + /** + * Last time the project was accessed through the MCP server. Empty if it was never accessed via MCP. + */ + mcpAccessedAt?: string; /** * OAuth2 server status */ @@ -4901,44 +4807,6 @@ export namespace Models { sdks: string[]; }; - /** - * DevKey - */ - export type DevKey = { - /** - * Key ID. - */ - $id: string; - /** - * Key creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Key update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Key name. - */ - name: string; - /** - * Key expiration date in ISO 8601 format. - */ - expire: string; - /** - * Secret key. - */ - secret: string; - /** - * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. - */ - accessedAt: string; - /** - * List of SDK user agents that used this key. - */ - sdks: string[]; - }; - /** * Mock Number */ @@ -5183,6 +5051,14 @@ export namespace Models { * Google OAuth2 prompt values. */ prompt: OAuth2GooglePrompt[]; + /** + * Native Google sign-in is active and can be used to create sessions from an ID token. Independent of enabled, which only controls the browser-based flow. + */ + nativeEnabled: boolean; + /** + * Additional OAuth2 client IDs accepted as ID token audiences for native sign-in, next to the client ID. + */ + nativeClientIds: string[]; }; /** @@ -5951,6 +5827,14 @@ export namespace Models { * Apple OAuth2 .p8 private key file contents. The secret key wrapped by the PEM markers is 200 characters long. */ p8File: string; + /** + * Native Sign in with Apple is active and can be used to create sessions from an ID token. Independent of enabled, which only controls the browser-based flow. + */ + nativeEnabled: boolean; + /** + * App bundle IDs accepted as ID token audiences for native Sign in with Apple, next to the Services ID. + */ + nativeClientIds: string[]; }; /** @@ -6001,6 +5885,50 @@ export namespace Models { clientSecret: string; }; + /** + * OAuth2TikTok + */ + export type OAuth2TikTok = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * TikTok OAuth2 client key. + */ + clientId: string; + /** + * TikTok OAuth2 client secret. + */ + clientSecret: string; + }; + + /** + * OAuth2Kakao + */ + export type OAuth2Kakao = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Kakao OAuth2 REST API key. + */ + clientId: string; + /** + * Kakao OAuth2 client secret. + */ + clientSecret: string; + }; + /** * OAuth2 Providers List */ @@ -6057,6 +5985,8 @@ export namespace Models { | Models.OAuth2HuggingFace | Models.OAuth2Resend | Models.OAuth2Cloudflare + | Models.OAuth2TikTok + | Models.OAuth2Kakao )[]; }; @@ -6132,6 +6062,28 @@ export namespace Models { enabled: boolean; }; + /** + * Policy Password Pwned + */ + export type PolicyPasswordPwned = { + /** + * Policy ID. + */ + $id: string; + /** + * Whether passwords are checked against known data breaches and the result recorded on the user. + */ + enabled: boolean; + /** + * Whether a sign-in with a breached password is refused until the password is reset. + */ + sessions: boolean; + /** + * Whether a breached password is rejected when a user signs up or sets a new password. + */ + users: boolean; + }; + /** * Policy Session Alert */ @@ -6262,6 +6214,62 @@ export namespace Models { custom: boolean; }; + /** + * Policy Deny Aliased Email + */ + export type PolicyDenyAliasedEmail = { + /** + * Policy ID. + */ + $id: string; + /** + * Whether the deny aliased email policy is enabled. + */ + enabled: boolean; + }; + + /** + * Policy Deny Disposable Email + */ + export type PolicyDenyDisposableEmail = { + /** + * Policy ID. + */ + $id: string; + /** + * Whether the deny disposable email policy is enabled. + */ + enabled: boolean; + }; + + /** + * Policy Deny Free Email + */ + export type PolicyDenyFreeEmail = { + /** + * Policy ID. + */ + $id: string; + /** + * Whether the deny free email policy is enabled. + */ + enabled: boolean; + }; + + /** + * Policy Deny Corporate Email + */ + export type PolicyDenyCorporateEmail = { + /** + * Policy ID. + */ + $id: string; + /** + * Whether the deny non-corporate email policy is enabled. + */ + enabled: boolean; + }; + /** * Platform Web */ @@ -6942,6 +6950,14 @@ export namespace Models { * Subscribe permissions. */ subscribe: string[]; + /** + * MQTT QoS for delivery on this topic. Null lets the subscriber choose their level. + */ + qos?: number; + /** + * Message retention in seconds for offline delivery. + */ + expiry?: number; }; /** @@ -7758,6 +7774,10 @@ export namespace Models { * Does plan require billing address */ requiresBillingAddress: boolean; + /** + * ISO country codes eligible for this regional plan. Empty means no restriction. + */ + eligibleCountries?: string[]; /** * Is the billing plan available */ @@ -8046,34 +8066,10 @@ export namespace Models { * Block mode. full blocks reads and writes; readOnly blocks writes only. */ mode: string; - /** - * Reason for the block. Can be null if no reason was provided. - */ - reason?: string; /** * Block expiration date in ISO 8601 format. Can be null if the block does not expire. */ expiredAt?: string; - /** - * Name of the project this block applies to. - */ - projectName: string; - /** - * Region of the project this block applies to. - */ - region: string; - /** - * Name of the organization that owns the project. - */ - organizationName: string; - /** - * ID of the organization that owns the project. - */ - organizationId: string; - /** - * Billing plan of the organization that owns the project. - */ - billingPlan: string; }; /** @@ -8295,7 +8291,7 @@ export namespace Models { */ status: string; /** - * Container status for lifecycle-managed database runtimes: active or inactive. + * Container status for lifecycle-managed database runtimes: active, inactive, or failed (a wake was declined because the backing namespace is gone). */ containerStatus: string; /** @@ -8326,6 +8322,18 @@ export namespace Models { * Storage allocated in GB. */ storage: number; + /** + * Storage resize status. Possible values: idle (no resize in flight), resizing (the volume is growing towards storageTargetGb). + */ + storageStatus: string; + /** + * Size in GB the volume is growing towards while storageStatus is resizing. 0 when no resize is in flight. + */ + storageTargetGb: number; + /** + * Time the in-flight storage resize started, in ISO 8601 format. + */ + storageResizeStartedAt?: string; /** * Storage class. Currently always 'ssd'; DigitalOcean exposes a single block-storage class. */ @@ -8379,7 +8387,7 @@ export namespace Models { */ storageAutoscalingThresholdPercent: number; /** - * Maximum storage size in GB for autoscaling. 0 means no limit. + * Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. */ storageAutoscalingMaxGb: number; /** @@ -8580,6 +8588,174 @@ export namespace Models { volumes: DatabaseStatusVolume[]; }; + /** + * DNSRecord + */ + export type DnsRecord = { + /** + * DNS Record ID. + */ + $id: string; + /** + * DNS Record creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * DNS Record update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * DNS record type (e.g. A, CNAME, MX). + */ + type: string; + /** + * Record name or subdomain. + */ + name: string; + /** + * Value of the record (IP address, domain, etc.). + */ + value: string; + /** + * Time to live (in seconds). + */ + ttl: number; + /** + * Record priority (commonly used for MX). + */ + priority: number; + /** + * Whether this record is locked (read-only). + */ + lock: boolean; + /** + * Record weight (used for SRV records). + */ + weight: number; + /** + * Target port (used for SRV records). + */ + port: number; + /** + * Comment for the DNS record. + */ + comment: string; + }; + + /** + * Domain + */ + export type Domain = { + /** + * Domain ID. + */ + $id: string; + /** + * Domain creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Domain update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Domain name. + */ + domain: string; + /** + * Domain registrar (e.g. "appwrite" or "third_party"). + */ + registrar: string; + /** + * Nameservers setting. "Appwrite" or empty string. + */ + nameservers: string; + /** + * Domain expiry date in ISO 8601 format. + */ + expire: string; + /** + * Domain renewal date in ISO 8601 format. + */ + renewal: string; + /** + * If set to true, the domain will automatically renew. + */ + autoRenewal: boolean; + /** + * Renewal price (in cents). + */ + renewalPrice: number; + /** + * Transfer status for domains being transferred in. Null when the domain is not being transferred. + */ + transferStatus?: DomainTransferStatusEnum; + /** + * Team ID. + */ + teamId: string; + /** + * Dns records + */ + dnsRecords: DnsRecord[]; + }; + + /** + * DomainPrice + */ + export type DomainPrice = { + /** + * Domain name. + */ + domain: string; + /** + * Top-level domain for the requested domain. + */ + tld: string; + /** + * Whether the domain is currently available for registration. + */ + available: boolean; + /** + * Domain registration price. Null when the price could not be resolved, for example for an unsupported TLD. + */ + price?: number; + /** + * Price period in years. + */ + periodYears: number; + /** + * Whether the domain is a premium domain. + */ + premium: boolean; + /** + * Domain renewal price for the same period. Null when the domain was not priced or the registrar has no renewal price for it. + */ + renewalPrice?: number; + /** + * Renewal price period in years. + */ + renewalPeriodYears: number; + }; + + /** + * domainTransferStatus + */ + export type DomainTransferStatus = { + /** + * Transfer status. + */ + status: DomainTransferStatusEnum; + /** + * Additional transfer status information. + */ + reason: string; + /** + * Transfer status timestamp in ISO 8601 format. + */ + timestamp: string; + }; + /** * Extensions */ @@ -8964,62 +9140,6 @@ export namespace Models { enabled: boolean; }; - /** - * Policy Deny Aliased Email - */ - export type PolicyDenyAliasedEmail = { - /** - * Policy ID. - */ - $id: string; - /** - * Whether the deny aliased email policy is enabled. - */ - enabled: boolean; - }; - - /** - * Policy Deny Disposable Email - */ - export type PolicyDenyDisposableEmail = { - /** - * Policy ID. - */ - $id: string; - /** - * Whether the deny disposable email policy is enabled. - */ - enabled: boolean; - }; - - /** - * Policy Deny Free Email - */ - export type PolicyDenyFreeEmail = { - /** - * Policy ID. - */ - $id: string; - /** - * Whether the deny free email policy is enabled. - */ - enabled: boolean; - }; - - /** - * Policy Deny Corporate Email - */ - export type PolicyDenyCorporateEmail = { - /** - * Policy ID. - */ - $id: string; - /** - * Whether the deny non-corporate email policy is enabled. - */ - enabled: boolean; - }; - /** * PoolerConfig */ @@ -9210,6 +9330,22 @@ export namespace Models { * Monthly price of the specification in USD. */ price: number; + /** + * Price per GB of storage above the included amount, per month, in USD. + */ + storageOverageRate: number; + /** + * Price per GB of bandwidth above the included amount, per month, in USD. + */ + bandwidthOverageRate: number; + /** + * High availability replica price as a fraction of the specification price. + */ + replicaRate: number; + /** + * Point-in-time recovery price as a fraction of the specification price. + */ + pitrRate: number; /** * Allocated CPU in millicores. */ @@ -9248,32 +9384,6 @@ export namespace Models { * Total number of specifications. */ total: number; - /** - * Overage and add-on pricing shared across all specifications. - */ - pricing: DedicatedDatabaseSpecificationPricing; - }; - - /** - * SpecificationPricing - */ - export type DedicatedDatabaseSpecificationPricing = { - /** - * Price per GB of storage above the included amount, per month, in USD. - */ - storageOverageRate: number; - /** - * Price per GB of bandwidth above the included amount, per month, in USD. - */ - bandwidthOverageRate: number; - /** - * High availability replica price as a fraction of the specification cost. - */ - replicaRate: number; - /** - * Point-in-time recovery price as a fraction of the specification cost. - */ - pitrRate: number; }; /** @@ -9862,6 +9972,60 @@ export namespace Models { id_token?: string; }; + /** + * OAuth2 Introspection + */ + export type Oauth2Introspection = { + /** + * Whether the token is currently active. An inactive token carries no other claims (RFC 7662). + */ + active: boolean; + /** + * Kind of token that was introspected. Can be one of: `access_token` or `refresh_token`. + */ + token_use?: string; + /** + * OAuth2 token type. + */ + token_type?: string; + /** + * Space-separated scopes granted to the token. + */ + scope?: string; + /** + * OAuth2 client ID the token was issued to. + */ + client_id?: string; + /** + * ID of the user who authorized the token. + */ + sub?: string; + /** + * Audiences the token is intended for. The first entry is the project API base URL; any further entries are the resource indicators requested at authorization time (RFC 8707). + */ + aud?: string[]; + /** + * Issuer URL of the token. + */ + iss?: string; + /** + * Expiration time as a Unix timestamp in seconds. + */ + exp?: number; + /** + * Issued-at time as a Unix timestamp in seconds. + */ + iat?: number; + /** + * Unique identifier of the token. + */ + jti?: string; + /** + * Granted RFC 9396 authorization details, restricted to what the user can currently access. + */ + authorization_details?: Record[]; + }; + /** * OAuth2 Consent */ @@ -10126,6 +10290,48 @@ export namespace Models { databases: DedicatedDatabase[]; }; + /** + * DNS records list + */ + export type DnsRecordsList = { + /** + * Total number of dnsRecords that matched your query. + */ + total: number; + /** + * List of dnsRecords. + */ + dnsRecords: DnsRecord[]; + }; + + /** + * Domain prices list + */ + export type DomainPricesList = { + /** + * Total number of prices that matched your query. + */ + total: number; + /** + * List of prices. + */ + prices: DomainPrice[]; + }; + + /** + * Domains list + */ + export type DomainsList = { + /** + * Total number of domains that matched your query. + */ + total: number; + /** + * List of domains. + */ + domains: Domain[]; + }; + /** * Apps list */ diff --git a/src/services/account.ts b/src/services/account.ts index 02085be2..04bab0ef 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -3,6 +3,7 @@ import type { Models } from '../models'; import { AuthenticatorType } from '../enums/authenticator-type'; import { AuthenticationFactor } from '../enums/authentication-factor'; +import { IdTokenProvider } from '../enums/id-token-provider'; import { OAuthProvider } from '../enums/o-auth-provider'; export class Account { client: Client; @@ -172,7 +173,7 @@ export class Account { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -243,7 +244,7 @@ export class Account { } const consentId = params.consentId; - if (typeof consentId === 'undefined') { + if (typeof consentId === 'undefined' || consentId === '') { throw new AppwriteException( 'Missing required parameter: "consentId"', ); @@ -296,7 +297,7 @@ export class Account { } const consentId = params.consentId; - if (typeof consentId === 'undefined') { + if (typeof consentId === 'undefined' || consentId === '') { throw new AppwriteException( 'Missing required parameter: "consentId"', ); @@ -374,7 +375,7 @@ export class Account { const consentId = params.consentId; const queries = params.queries; const total = params.total; - if (typeof consentId === 'undefined') { + if (typeof consentId === 'undefined' || consentId === '') { throw new AppwriteException( 'Missing required parameter: "consentId"', ); @@ -449,12 +450,12 @@ export class Account { const consentId = params.consentId; const tokenId = params.tokenId; - if (typeof consentId === 'undefined') { + if (typeof consentId === 'undefined' || consentId === '') { throw new AppwriteException( 'Missing required parameter: "consentId"', ); } - if (typeof tokenId === 'undefined') { + if (typeof tokenId === 'undefined' || tokenId === '') { throw new AppwriteException( 'Missing required parameter: "tokenId"', ); @@ -519,12 +520,12 @@ export class Account { const consentId = params.consentId; const tokenId = params.tokenId; - if (typeof consentId === 'undefined') { + if (typeof consentId === 'undefined' || consentId === '') { throw new AppwriteException( 'Missing required parameter: "consentId"', ); } - if (typeof tokenId === 'undefined') { + if (typeof tokenId === 'undefined' || tokenId === '') { throw new AppwriteException( 'Missing required parameter: "tokenId"', ); @@ -659,7 +660,7 @@ export class Account { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -730,7 +731,7 @@ export class Account { } const identityId = params.identityId; - if (typeof identityId === 'undefined') { + if (typeof identityId === 'undefined' || identityId === '') { throw new AppwriteException( 'Missing required parameter: "identityId"', ); @@ -745,74 +746,10 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', - }; - - return this.client.call('delete', uri, apiHeaders, apiPayload); - } - - /** - * Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. - * - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset - * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - */ - listLogs(params?: { - queries?: string[]; - total?: boolean; - }): Promise; - /** - * Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. - * - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset - * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listLogs(queries?: string[], total?: boolean): Promise; - listLogs( - paramsOrFirst?: { queries?: string[]; total?: boolean } | string[], - ...rest: [boolean?] - ): Promise { - let params: { queries?: string[]; total?: boolean }; - - if ( - !paramsOrFirst || - (paramsOrFirst && - typeof paramsOrFirst === 'object' && - !Array.isArray(paramsOrFirst)) - ) { - params = (paramsOrFirst || {}) as { - queries?: string[]; - total?: boolean; - }; - } else { - params = { - queries: paramsOrFirst as string[], - total: rest[0] as boolean, - }; - } - - const queries = params.queries; - const total = params.total; - const apiPath = '/account/logs'; - const apiPayload: Payload = {}; - if (typeof queries !== 'undefined') { - apiPayload['queries'] = queries; - } - if (typeof total !== 'undefined') { - apiPayload['total'] = total; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'X-Appwrite-Project': this.client.config.project, accept: 'application/json', }; - return this.client.call('get', uri, apiHeaders, apiPayload); + return this.client.call('delete', uri, apiHeaders, apiPayload); } /** @@ -1199,6 +1136,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -1253,6 +1191,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -2154,6 +2093,172 @@ export class Account { return this.client.call('put', uri, apiHeaders, apiPayload); } + /** + * Use this endpoint to send a 6-digit password recovery code to the user's email address. Unlike [createRecovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery), this method requires no redirect URL, which makes it suitable for mobile and desktop apps that cannot host a recovery page. Learn more about how to [complete the recovery process](https://appwrite.io/docs/references/cloud/client-web/account#updateRecoveryOTP). The code sent to the user's email address is valid for 15 minutes. + * + * Enable the **phrase** parameter to include a randomly generated security phrase in both the email and the response. Showing that phrase in your app lets the user confirm the email genuinely came from your request, which helps protect against phishing. + * + * + * @param {string} params.email - User email. + * @param {boolean} params.phrase - Toggle for security phrase. If enabled, email will be sent with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. + * @throws {AppwriteException} + * @returns {Promise} + */ + createRecoveryOTP(params: { + email: string; + phrase?: boolean; + }): Promise; + /** + * Use this endpoint to send a 6-digit password recovery code to the user's email address. Unlike [createRecovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery), this method requires no redirect URL, which makes it suitable for mobile and desktop apps that cannot host a recovery page. Learn more about how to [complete the recovery process](https://appwrite.io/docs/references/cloud/client-web/account#updateRecoveryOTP). The code sent to the user's email address is valid for 15 minutes. + * + * Enable the **phrase** parameter to include a randomly generated security phrase in both the email and the response. Showing that phrase in your app lets the user confirm the email genuinely came from your request, which helps protect against phishing. + * + * + * @param {string} email - User email. + * @param {boolean} phrase - Toggle for security phrase. If enabled, email will be sent with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createRecoveryOTP(email: string, phrase?: boolean): Promise; + createRecoveryOTP( + paramsOrFirst: { email: string; phrase?: boolean } | string, + ...rest: [boolean?] + ): Promise { + let params: { email: string; phrase?: boolean }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + email: string; + phrase?: boolean; + }; + } else { + params = { + email: paramsOrFirst as string, + phrase: rest[0] as boolean, + }; + } + + const email = params.email; + const phrase = params.phrase; + if (typeof email === 'undefined') { + throw new AppwriteException('Missing required parameter: "email"'); + } + const apiPath = '/account/recovery/otp'; + const apiPayload: Payload = {}; + if (typeof email !== 'undefined') { + apiPayload['email'] = email; + } + if (typeof phrase !== 'undefined') { + apiPayload['phrase'] = phrase; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * Use this endpoint to complete the user password recovery process using the 6-digit code that was emailed by [createRecoveryOTP](https://appwrite.io/docs/references/cloud/client-web/account#createRecoveryOTP). Pass the **userId** of the user along with the **secret** code from the email and the new **password** to set. If confirmed, this route will return a 200 status code, the code is consumed and the user's password is updated. + * + * + * @param {string} params.userId - User ID. + * @param {string} params.secret - Valid recovery OTP code. + * @param {string} params.password - New user password. Must be between 8 and 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateRecoveryOTP(params: { + userId: string; + secret: string; + password: string; + }): Promise; + /** + * Use this endpoint to complete the user password recovery process using the 6-digit code that was emailed by [createRecoveryOTP](https://appwrite.io/docs/references/cloud/client-web/account#createRecoveryOTP). Pass the **userId** of the user along with the **secret** code from the email and the new **password** to set. If confirmed, this route will return a 200 status code, the code is consumed and the user's password is updated. + * + * + * @param {string} userId - User ID. + * @param {string} secret - Valid recovery OTP code. + * @param {string} password - New user password. Must be between 8 and 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateRecoveryOTP( + userId: string, + secret: string, + password: string, + ): Promise; + updateRecoveryOTP( + paramsOrFirst: + { userId: string; secret: string; password: string } | string, + ...rest: [string?, string?] + ): Promise { + let params: { userId: string; secret: string; password: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + userId: string; + secret: string; + password: string; + }; + } else { + params = { + userId: paramsOrFirst as string, + secret: rest[0] as string, + password: rest[1] as string, + }; + } + + const userId = params.userId; + const secret = params.secret; + const password = params.password; + if (typeof userId === 'undefined') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + if (typeof secret === 'undefined') { + throw new AppwriteException('Missing required parameter: "secret"'); + } + if (typeof password === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "password"', + ); + } + const apiPath = '/account/recovery/otp'; + const apiPayload: Payload = {}; + if (typeof userId !== 'undefined') { + apiPayload['userId'] = userId; + } + if (typeof secret !== 'undefined') { + apiPayload['secret'] = secret; + } + if (typeof password !== 'undefined') { + apiPayload['password'] = password; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('put', uri, apiHeaders, apiPayload); + } + /** * Get the list of active sessions across different devices for the currently logged in user. * @@ -2187,6 +2292,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -2292,6 +2398,168 @@ export class Account { return this.client.call('post', uri, apiHeaders, apiPayload); } + /** + * Allow the user to login to their account using an OpenID Connect ID token obtained natively from the OAuth2 provider, for example via Google Credential Manager on Android or Sign in with Apple on iOS. No browser or redirect is involved: the ID token is verified against the provider's published signing keys and a session is created in a single request. + * + * Native sign-in is switched on per provider with its nativeEnabled setting. It is independent of the browser-based flow's enabled setting, which has no effect on this endpoint. The token's audience must match the provider's configured client ID or one of its native client IDs; tokens issued for any other client ID are rejected. For Sign in with Apple, register your app's bundle ID as a native client ID. For Google, the web client ID used by Credential Manager is usually the configured client ID; add your Android and iOS client IDs as native client IDs if your app requests tokens for them. + * + * Pass the raw nonce used when requesting the ID token so it can be validated against the token's nonce claim. When signing in with Apple, the nonce is required: hash it with SHA-256 before passing it to the Apple SDK, and send the raw value here - Apple tokens requested without a nonce are rejected. For Google the nonce is optional: it is validated whenever the token carries one, and ignored when the provider issued the token without one. Apple only returns the user's name on the first authorization, and never inside the ID token - capture it on the client and pass it via the name parameter. + * + * If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the verified email received from the provider and attach the new session to the existing user. If no matching user is found - the server will create a new user. + * + * This flow does not return provider refresh tokens. You may pass an access token the provider handed your client, along with its lifetime, to store it on the session - but Appwrite cannot renew it once it expires. If your app needs long-lived access to provider APIs, use the browser-based OAuth2 flow instead. + * + * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + * + * + * @param {IdTokenProvider} params.provider - OAuth2 provider that issued the ID token. Currently, supported providers are: apple, google. + * @param {string} params.idToken - OpenID Connect ID token (JWT) obtained natively from the provider, for example via Google Credential Manager or Sign in with Apple. + * @param {string} params.nonce - Raw nonce used when requesting the ID token. Required for Apple, and whenever the token carries a nonce claim, which must match it. Ignored when the provider issued the token without a nonce. + * @param {string} params.accessToken - Provider access token to store alongside the session for calling provider APIs. Never used for authentication. + * @param {number} params.accessTokenExpiry - Seconds until the provider access token expires, as reported by the provider. Stored so clients can tell when the stored token goes stale. + * @param {string} params.name - User name. Only used when creating a new user and the ID token has no name claim, such as on the first Sign in with Apple authorization. + * @throws {AppwriteException} + * @returns {Promise} + */ + createIdTokenSession(params: { + provider: IdTokenProvider; + idToken: string; + nonce?: string; + accessToken?: string; + accessTokenExpiry?: number; + name?: string; + }): Promise; + /** + * Allow the user to login to their account using an OpenID Connect ID token obtained natively from the OAuth2 provider, for example via Google Credential Manager on Android or Sign in with Apple on iOS. No browser or redirect is involved: the ID token is verified against the provider's published signing keys and a session is created in a single request. + * + * Native sign-in is switched on per provider with its nativeEnabled setting. It is independent of the browser-based flow's enabled setting, which has no effect on this endpoint. The token's audience must match the provider's configured client ID or one of its native client IDs; tokens issued for any other client ID are rejected. For Sign in with Apple, register your app's bundle ID as a native client ID. For Google, the web client ID used by Credential Manager is usually the configured client ID; add your Android and iOS client IDs as native client IDs if your app requests tokens for them. + * + * Pass the raw nonce used when requesting the ID token so it can be validated against the token's nonce claim. When signing in with Apple, the nonce is required: hash it with SHA-256 before passing it to the Apple SDK, and send the raw value here - Apple tokens requested without a nonce are rejected. For Google the nonce is optional: it is validated whenever the token carries one, and ignored when the provider issued the token without one. Apple only returns the user's name on the first authorization, and never inside the ID token - capture it on the client and pass it via the name parameter. + * + * If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the verified email received from the provider and attach the new session to the existing user. If no matching user is found - the server will create a new user. + * + * This flow does not return provider refresh tokens. You may pass an access token the provider handed your client, along with its lifetime, to store it on the session - but Appwrite cannot renew it once it expires. If your app needs long-lived access to provider APIs, use the browser-based OAuth2 flow instead. + * + * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + * + * + * @param {IdTokenProvider} provider - OAuth2 provider that issued the ID token. Currently, supported providers are: apple, google. + * @param {string} idToken - OpenID Connect ID token (JWT) obtained natively from the provider, for example via Google Credential Manager or Sign in with Apple. + * @param {string} nonce - Raw nonce used when requesting the ID token. Required for Apple, and whenever the token carries a nonce claim, which must match it. Ignored when the provider issued the token without a nonce. + * @param {string} accessToken - Provider access token to store alongside the session for calling provider APIs. Never used for authentication. + * @param {number} accessTokenExpiry - Seconds until the provider access token expires, as reported by the provider. Stored so clients can tell when the stored token goes stale. + * @param {string} name - User name. Only used when creating a new user and the ID token has no name claim, such as on the first Sign in with Apple authorization. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createIdTokenSession( + provider: IdTokenProvider, + idToken: string, + nonce?: string, + accessToken?: string, + accessTokenExpiry?: number, + name?: string, + ): Promise; + createIdTokenSession( + paramsOrFirst: + | { + provider: IdTokenProvider; + idToken: string; + nonce?: string; + accessToken?: string; + accessTokenExpiry?: number; + name?: string; + } + | IdTokenProvider, + ...rest: [string?, string?, string?, number?, string?] + ): Promise { + let params: { + provider: IdTokenProvider; + idToken: string; + nonce?: string; + accessToken?: string; + accessTokenExpiry?: number; + name?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + ('provider' in paramsOrFirst || + 'idToken' in paramsOrFirst || + 'nonce' in paramsOrFirst || + 'accessToken' in paramsOrFirst || + 'accessTokenExpiry' in paramsOrFirst || + 'name' in paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + provider: IdTokenProvider; + idToken: string; + nonce?: string; + accessToken?: string; + accessTokenExpiry?: number; + name?: string; + }; + } else { + params = { + provider: paramsOrFirst as IdTokenProvider, + idToken: rest[0] as string, + nonce: rest[1] as string, + accessToken: rest[2] as string, + accessTokenExpiry: rest[3] as number, + name: rest[4] as string, + }; + } + + const provider = params.provider; + const idToken = params.idToken; + const nonce = params.nonce; + const accessToken = params.accessToken; + const accessTokenExpiry = params.accessTokenExpiry; + const name = params.name; + if (typeof provider === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "provider"', + ); + } + if (typeof idToken === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "idToken"', + ); + } + const apiPath = '/account/sessions/id-token'; + const apiPayload: Payload = {}; + if (typeof provider !== 'undefined') { + apiPayload['provider'] = provider; + } + if (typeof idToken !== 'undefined') { + apiPayload['idToken'] = idToken; + } + if (typeof nonce !== 'undefined') { + apiPayload['nonce'] = nonce; + } + if (typeof accessToken !== 'undefined') { + apiPayload['accessToken'] = accessToken; + } + if (typeof accessTokenExpiry !== 'undefined') { + apiPayload['accessTokenExpiry'] = accessTokenExpiry; + } + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + /** * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. * @@ -2545,7 +2813,7 @@ export class Account { } const sessionId = params.sessionId; - if (typeof sessionId === 'undefined') { + if (typeof sessionId === 'undefined' || sessionId === '') { throw new AppwriteException( 'Missing required parameter: "sessionId"', ); @@ -2600,7 +2868,7 @@ export class Account { } const sessionId = params.sessionId; - if (typeof sessionId === 'undefined') { + if (typeof sessionId === 'undefined' || sessionId === '') { throw new AppwriteException( 'Missing required parameter: "sessionId"', ); @@ -2654,7 +2922,7 @@ export class Account { } const sessionId = params.sessionId; - if (typeof sessionId === 'undefined') { + if (typeof sessionId === 'undefined' || sessionId === '') { throw new AppwriteException( 'Missing required parameter: "sessionId"', ); @@ -2669,6 +2937,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -2899,9 +3168,11 @@ export class Account { * * If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint. * + * If there is already an active session, the OAuth2 identity is attached to the logged-in account and that session stays active until the token is exchanged for a new one. + * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. + * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, kakao, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tiktok, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. * @param {string} params.success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string} params.failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string[]} params.scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. @@ -2919,9 +3190,11 @@ export class Account { * * If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint. * + * If there is already an active session, the OAuth2 identity is attached to the logged-in account and that session stays active until the token is exchanged for a new one. + * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. + * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, kakao, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tiktok, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. * @param {string} success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string} failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string[]} scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. @@ -3349,6 +3622,142 @@ export class Account { return this.client.call('put', uri, apiHeaders, apiPayload); } + /** + * Use this endpoint to send a 6-digit verification code to the currently logged in user's email address. Unlike [createEmailVerification](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerification), this method requires no redirect URL, which makes it suitable for mobile and desktop apps that cannot host a verification page. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateEmailVerificationOTP). The code sent to the user's email address is valid for 15 minutes. + * + * Enable the **phrase** parameter to include a randomly generated security phrase in both the email and the response. Showing that phrase in your app lets the user confirm the email genuinely came from your request, which helps protect against phishing. + * + * + * @param {boolean} params.phrase - Toggle for security phrase. If enabled, email will be sent with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. + * @throws {AppwriteException} + * @returns {Promise} + */ + createEmailVerificationOTP(params?: { + phrase?: boolean; + }): Promise; + /** + * Use this endpoint to send a 6-digit verification code to the currently logged in user's email address. Unlike [createEmailVerification](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerification), this method requires no redirect URL, which makes it suitable for mobile and desktop apps that cannot host a verification page. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateEmailVerificationOTP). The code sent to the user's email address is valid for 15 minutes. + * + * Enable the **phrase** parameter to include a randomly generated security phrase in both the email and the response. Showing that phrase in your app lets the user confirm the email genuinely came from your request, which helps protect against phishing. + * + * + * @param {boolean} phrase - Toggle for security phrase. If enabled, email will be sent with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createEmailVerificationOTP(phrase?: boolean): Promise; + createEmailVerificationOTP( + paramsOrFirst?: { phrase?: boolean } | boolean, + ): Promise { + let params: { phrase?: boolean }; + + if ( + typeof paramsOrFirst === 'undefined' || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { + params = (paramsOrFirst || {}) as { phrase?: boolean }; + } else { + params = { + phrase: paramsOrFirst as boolean, + }; + } + + const phrase = params.phrase; + const apiPath = '/account/verifications/email/otp'; + const apiPayload: Payload = {}; + if (typeof phrase !== 'undefined') { + apiPayload['phrase'] = phrase; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * Use this endpoint to complete the user email verification process using the 6-digit code that was emailed by [createEmailVerificationOTP](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerificationOTP). Pass the **userId** of the user being verified along with the **secret** code from the email. If confirmed, this route will return a 200 status code and the code is consumed. + * + * + * @param {string} params.userId - User ID. + * @param {string} params.secret - Valid verification OTP code. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateEmailVerificationOTP(params: { + userId: string; + secret: string; + }): Promise; + /** + * Use this endpoint to complete the user email verification process using the 6-digit code that was emailed by [createEmailVerificationOTP](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerificationOTP). Pass the **userId** of the user being verified along with the **secret** code from the email. If confirmed, this route will return a 200 status code and the code is consumed. + * + * + * @param {string} userId - User ID. + * @param {string} secret - Valid verification OTP code. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateEmailVerificationOTP( + userId: string, + secret: string, + ): Promise; + updateEmailVerificationOTP( + paramsOrFirst: { userId: string; secret: string } | string, + ...rest: [string?] + ): Promise { + let params: { userId: string; secret: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + userId: string; + secret: string; + }; + } else { + params = { + userId: paramsOrFirst as string, + secret: rest[0] as string, + }; + } + + const userId = params.userId; + const secret = params.secret; + if (typeof userId === 'undefined') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + if (typeof secret === 'undefined') { + throw new AppwriteException('Missing required parameter: "secret"'); + } + const apiPath = '/account/verifications/email/otp'; + const apiPayload: Payload = {}; + if (typeof userId !== 'undefined') { + apiPayload['userId'] = userId; + } + if (typeof secret !== 'undefined') { + apiPayload['secret'] = secret; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('put', uri, apiHeaders, apiPayload); + } + /** * Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes. * diff --git a/src/services/activities.ts b/src/services/activities.ts index 0b5eb511..74bae79f 100644 --- a/src/services/activities.ts +++ b/src/services/activities.ts @@ -33,7 +33,7 @@ export class Activities { let params: { queries?: string[] }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -98,7 +98,7 @@ export class Activities { } const eventId = params.eventId; - if (typeof eventId === 'undefined') { + if (typeof eventId === 'undefined' || eventId === '') { throw new AppwriteException( 'Missing required parameter: "eventId"', ); diff --git a/src/services/advisor.ts b/src/services/advisor.ts index d511b8e9..0ffcdfb9 100644 --- a/src/services/advisor.ts +++ b/src/services/advisor.ts @@ -42,7 +42,7 @@ export class Advisor { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -115,7 +115,7 @@ export class Advisor { } const reportId = params.reportId; - if (typeof reportId === 'undefined') { + if (typeof reportId === 'undefined' || reportId === '') { throw new AppwriteException( 'Missing required parameter: "reportId"', ); @@ -170,7 +170,7 @@ export class Advisor { } const reportId = params.reportId; - if (typeof reportId === 'undefined') { + if (typeof reportId === 'undefined' || reportId === '') { throw new AppwriteException( 'Missing required parameter: "reportId"', ); @@ -185,6 +185,7 @@ export class Advisor { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -249,7 +250,7 @@ export class Advisor { const reportId = params.reportId; const queries = params.queries; const total = params.total; - if (typeof reportId === 'undefined') { + if (typeof reportId === 'undefined' || reportId === '') { throw new AppwriteException( 'Missing required parameter: "reportId"', ); @@ -323,12 +324,12 @@ export class Advisor { const reportId = params.reportId; const insightId = params.insightId; - if (typeof reportId === 'undefined') { + if (typeof reportId === 'undefined' || reportId === '') { throw new AppwriteException( 'Missing required parameter: "reportId"', ); } - if (typeof insightId === 'undefined') { + if (typeof insightId === 'undefined' || insightId === '') { throw new AppwriteException( 'Missing required parameter: "insightId"', ); diff --git a/src/services/apps.ts b/src/services/apps.ts index d13ab47a..54b4b2cb 100644 --- a/src/services/apps.ts +++ b/src/services/apps.ts @@ -37,7 +37,7 @@ export class Apps { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -454,7 +454,7 @@ export class Apps { } const appId = params.appId; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } const apiPath = '/apps/{appId}'.replace( @@ -711,7 +711,7 @@ export class Apps { const deviceFlow = params.deviceFlow; const installationScopes = params.installationScopes; const installationRedirectUrl = params.installationRedirectUrl; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } if (typeof name === 'undefined') { @@ -823,7 +823,7 @@ export class Apps { } const appId = params.appId; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } const apiPath = '/apps/{appId}'.replace( @@ -899,7 +899,7 @@ export class Apps { const appId = params.appId; const queries = params.queries; const total = params.total; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } const apiPath = '/apps/{appId}/installations'.replace( @@ -972,10 +972,10 @@ export class Apps { const appId = params.appId; const installationId = params.installationId; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } - if (typeof installationId === 'undefined') { + if (typeof installationId === 'undefined' || installationId === '') { throw new AppwriteException( 'Missing required parameter: "installationId"', ); @@ -1043,10 +1043,10 @@ export class Apps { const appId = params.appId; const installationId = params.installationId; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } - if (typeof installationId === 'undefined') { + if (typeof installationId === 'undefined' || installationId === '') { throw new AppwriteException( 'Missing required parameter: "installationId"', ); @@ -1118,10 +1118,10 @@ export class Apps { const appId = params.appId; const installationId = params.installationId; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } - if (typeof installationId === 'undefined') { + if (typeof installationId === 'undefined' || installationId === '') { throw new AppwriteException( 'Missing required parameter: "installationId"', ); @@ -1201,7 +1201,7 @@ export class Apps { const appId = params.appId; const queries = params.queries; const total = params.total; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } const apiPath = '/apps/{appId}/keys'.replace( @@ -1260,7 +1260,7 @@ export class Apps { } const appId = params.appId; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } const apiPath = '/apps/{appId}/keys'.replace( @@ -1319,10 +1319,10 @@ export class Apps { const appId = params.appId; const keyId = params.keyId; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } - if (typeof keyId === 'undefined') { + if (typeof keyId === 'undefined' || keyId === '') { throw new AppwriteException('Missing required parameter: "keyId"'); } const apiPath = '/apps/{appId}/keys/{keyId}' @@ -1379,10 +1379,10 @@ export class Apps { const appId = params.appId; const keyId = params.keyId; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } - if (typeof keyId === 'undefined') { + if (typeof keyId === 'undefined' || keyId === '') { throw new AppwriteException('Missing required parameter: "keyId"'); } const apiPath = '/apps/{appId}/keys/{keyId}' @@ -1404,7 +1404,7 @@ export class Apps { * Update the labels of an application. Labels are read-only for clients; only a server SDK using a project API key can set them. Replaces the previous labels. * * @param {string} params.appId - Application unique ID. - * @param {string[]} params.labels - Array of application labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. + * @param {string[]} params.labels - Array of application labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. Reserved labels are rejected. * @throws {AppwriteException} * @returns {Promise} */ @@ -1416,7 +1416,7 @@ export class Apps { * Update the labels of an application. Labels are read-only for clients; only a server SDK using a project API key can set them. Replaces the previous labels. * * @param {string} appId - Application unique ID. - * @param {string[]} labels - Array of application labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. + * @param {string[]} labels - Array of application labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. Reserved labels are rejected. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -1446,7 +1446,7 @@ export class Apps { const appId = params.appId; const labels = params.labels; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } if (typeof labels === 'undefined') { @@ -1528,7 +1528,7 @@ export class Apps { const appId = params.appId; const queries = params.queries; const total = params.total; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } const apiPath = '/apps/{appId}/secrets'.replace( @@ -1587,7 +1587,7 @@ export class Apps { } const appId = params.appId; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } const apiPath = '/apps/{appId}/secrets'.replace( @@ -1652,10 +1652,10 @@ export class Apps { const appId = params.appId; const secretId = params.secretId; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } - if (typeof secretId === 'undefined') { + if (typeof secretId === 'undefined' || secretId === '') { throw new AppwriteException( 'Missing required parameter: "secretId"', ); @@ -1717,10 +1717,10 @@ export class Apps { const appId = params.appId; const secretId = params.secretId; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } - if (typeof secretId === 'undefined') { + if (typeof secretId === 'undefined' || secretId === '') { throw new AppwriteException( 'Missing required parameter: "secretId"', ); @@ -1780,7 +1780,7 @@ export class Apps { const appId = params.appId; const teamId = params.teamId; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } if (typeof teamId === 'undefined') { @@ -1838,7 +1838,7 @@ export class Apps { } const appId = params.appId; - if (typeof appId === 'undefined') { + if (typeof appId === 'undefined' || appId === '') { throw new AppwriteException('Missing required parameter: "appId"'); } const apiPath = '/apps/{appId}/tokens'.replace( diff --git a/src/services/avatars.ts b/src/services/avatars.ts index e2f4afd3..4f83eb0e 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -579,7 +579,7 @@ export class Avatars { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -713,7 +713,7 @@ export class Avatars { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) diff --git a/src/services/backups.ts b/src/services/backups.ts index dad80a1c..633bb098 100644 --- a/src/services/backups.ts +++ b/src/services/backups.ts @@ -34,7 +34,7 @@ export class Backups { let params: { queries?: string[] }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -173,7 +173,7 @@ export class Backups { } const archiveId = params.archiveId; - if (typeof archiveId === 'undefined') { + if (typeof archiveId === 'undefined' || archiveId === '') { throw new AppwriteException( 'Missing required parameter: "archiveId"', ); @@ -226,7 +226,7 @@ export class Backups { } const archiveId = params.archiveId; - if (typeof archiveId === 'undefined') { + if (typeof archiveId === 'undefined' || archiveId === '') { throw new AppwriteException( 'Missing required parameter: "archiveId"', ); @@ -272,7 +272,7 @@ export class Backups { let params: { queries?: string[] }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -498,7 +498,7 @@ export class Backups { } const policyId = params.policyId; - if (typeof policyId === 'undefined') { + if (typeof policyId === 'undefined' || policyId === '') { throw new AppwriteException( 'Missing required parameter: "policyId"', ); @@ -602,7 +602,7 @@ export class Backups { const retention = params.retention; const schedule = params.schedule; const enabled = params.enabled; - if (typeof policyId === 'undefined') { + if (typeof policyId === 'undefined' || policyId === '') { throw new AppwriteException( 'Missing required parameter: "policyId"', ); @@ -668,7 +668,7 @@ export class Backups { } const policyId = params.policyId; - if (typeof policyId === 'undefined') { + if (typeof policyId === 'undefined' || policyId === '') { throw new AppwriteException( 'Missing required parameter: "policyId"', ); @@ -842,7 +842,7 @@ export class Backups { let params: { queries?: string[] }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -907,7 +907,7 @@ export class Backups { } const restorationId = params.restorationId; - if (typeof restorationId === 'undefined') { + if (typeof restorationId === 'undefined' || restorationId === '') { throw new AppwriteException( 'Missing required parameter: "restorationId"', ); diff --git a/src/services/databases.ts b/src/services/databases.ts index 5d06492c..81015d75 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -50,7 +50,7 @@ export class Databases { let params: { queries?: string[]; search?: string; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -208,7 +208,7 @@ export class Databases { let params: { queries?: string[] }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -260,7 +260,7 @@ export class Databases { let params: { ttl?: number }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -327,7 +327,7 @@ export class Databases { } const transactionId = params.transactionId; - if (typeof transactionId === 'undefined') { + if (typeof transactionId === 'undefined' || transactionId === '') { throw new AppwriteException( 'Missing required parameter: "transactionId"', ); @@ -410,7 +410,7 @@ export class Databases { const transactionId = params.transactionId; const commit = params.commit; const rollback = params.rollback; - if (typeof transactionId === 'undefined') { + if (typeof transactionId === 'undefined' || transactionId === '') { throw new AppwriteException( 'Missing required parameter: "transactionId"', ); @@ -473,7 +473,7 @@ export class Databases { } const transactionId = params.transactionId; - if (typeof transactionId === 'undefined') { + if (typeof transactionId === 'undefined' || transactionId === '') { throw new AppwriteException( 'Missing required parameter: "transactionId"', ); @@ -488,6 +488,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -544,7 +545,7 @@ export class Databases { const transactionId = params.transactionId; const operations = params.operations; - if (typeof transactionId === 'undefined') { + if (typeof transactionId === 'undefined' || transactionId === '') { throw new AppwriteException( 'Missing required parameter: "transactionId"', ); @@ -605,7 +606,7 @@ export class Databases { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -683,7 +684,7 @@ export class Databases { const databaseId = params.databaseId; const name = params.name; const enabled = params.enabled; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -744,7 +745,7 @@ export class Databases { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -759,6 +760,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -840,7 +842,7 @@ export class Databases { const queries = params.queries; const search = params.search; const total = params.total; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -989,7 +991,7 @@ export class Databases { const enabled = params.enabled; const attributes = params.attributes; const indexes = params.indexes; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1089,12 +1091,12 @@ export class Databases { const databaseId = params.databaseId; const collectionId = params.collectionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1219,12 +1221,12 @@ export class Databases { const documentSecurity = params.documentSecurity; const enabled = params.enabled; const purge = params.purge; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1309,12 +1311,12 @@ export class Databases { const databaseId = params.databaseId; const collectionId = params.collectionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1331,6 +1333,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -1412,12 +1415,12 @@ export class Databases { const collectionId = params.collectionId; const queries = params.queries; const total = params.total; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1568,12 +1571,12 @@ export class Databases { const max = params.max; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1745,17 +1748,17 @@ export class Databases { const min = params.min; const max = params.max; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -1899,12 +1902,12 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -2042,17 +2045,17 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -2188,12 +2191,12 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -2331,17 +2334,17 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -2479,12 +2482,12 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -2624,17 +2627,17 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -2781,12 +2784,12 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -2943,17 +2946,17 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof elements === 'undefined') { @@ -3125,12 +3128,12 @@ export class Databases { const max = params.max; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -3302,17 +3305,17 @@ export class Databases { const min = params.min; const max = params.max; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -3482,12 +3485,12 @@ export class Databases { const max = params.max; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -3659,17 +3662,17 @@ export class Databases { const min = params.min; const max = params.max; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -3813,12 +3816,12 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -3958,17 +3961,17 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -4095,12 +4098,12 @@ export class Databases { const key = params.key; const required = params.required; const xdefault = params.xdefault; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -4235,17 +4238,17 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -4387,12 +4390,12 @@ export class Databases { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -4535,17 +4538,17 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -4692,12 +4695,12 @@ export class Databases { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -4840,17 +4843,17 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -4977,12 +4980,12 @@ export class Databases { const key = params.key; const required = params.required; const xdefault = params.xdefault; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -5117,17 +5120,17 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -5249,12 +5252,12 @@ export class Databases { const key = params.key; const required = params.required; const xdefault = params.xdefault; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -5389,17 +5392,17 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -5558,12 +5561,12 @@ export class Databases { const key = params.key; const twoWayKey = params.twoWayKey; const onDelete = params.onDelete; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -5700,17 +5703,17 @@ export class Databases { const key = params.key; const onDelete = params.onDelete; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } const apiPath = @@ -5861,12 +5864,12 @@ export class Databases { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -6024,17 +6027,17 @@ export class Databases { const xdefault = params.xdefault; const size = params.size; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -6184,12 +6187,12 @@ export class Databases { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -6332,17 +6335,17 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -6480,12 +6483,12 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -6625,17 +6628,17 @@ export class Databases { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -6799,12 +6802,12 @@ export class Databases { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -6962,17 +6965,17 @@ export class Databases { const xdefault = params.xdefault; const size = params.size; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -7024,7 +7027,7 @@ export class Databases { * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getColumn` instead. */ getAttribute(params: { @@ -7033,6 +7036,7 @@ export class Databases { key: string; }): Promise< | Models.AttributeBoolean + | Models.AttributeBigint | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail @@ -7041,6 +7045,13 @@ export class Databases { | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship + | Models.AttributePoint + | Models.AttributeLine + | Models.AttributePolygon + | Models.AttributeVarchar + | Models.AttributeText + | Models.AttributeMediumtext + | Models.AttributeLongtext | Models.AttributeString >; /** @@ -7050,7 +7061,7 @@ export class Databases { * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getAttribute( @@ -7059,6 +7070,7 @@ export class Databases { key: string, ): Promise< | Models.AttributeBoolean + | Models.AttributeBigint | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail @@ -7067,6 +7079,13 @@ export class Databases { | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship + | Models.AttributePoint + | Models.AttributeLine + | Models.AttributePolygon + | Models.AttributeVarchar + | Models.AttributeText + | Models.AttributeMediumtext + | Models.AttributeLongtext | Models.AttributeString >; getAttribute( @@ -7075,6 +7094,7 @@ export class Databases { ...rest: [string?, string?] ): Promise< | Models.AttributeBoolean + | Models.AttributeBigint | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail @@ -7083,6 +7103,13 @@ export class Databases { | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship + | Models.AttributePoint + | Models.AttributeLine + | Models.AttributePolygon + | Models.AttributeVarchar + | Models.AttributeText + | Models.AttributeMediumtext + | Models.AttributeLongtext | Models.AttributeString > { let params: { databaseId: string; collectionId: string; key: string }; @@ -7108,17 +7135,17 @@ export class Databases { const databaseId = params.databaseId; const collectionId = params.collectionId; const key = params.key; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } const apiPath = @@ -7198,17 +7225,17 @@ export class Databases { const databaseId = params.databaseId; const collectionId = params.collectionId; const key = params.key; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } const apiPath = @@ -7225,6 +7252,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -7326,12 +7354,12 @@ export class Databases { const transactionId = params.transactionId; const total = params.total; const ttl = params.ttl; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -7487,12 +7515,12 @@ export class Databases { const data = params.data; const permissions = params.permissions; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -7614,12 +7642,12 @@ export class Databases { const collectionId = params.collectionId; const documents = params.documents; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -7734,12 +7762,12 @@ export class Databases { const collectionId = params.collectionId; const documents = params.documents; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -7861,12 +7889,12 @@ export class Databases { const data = params.data; const queries = params.queries; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -7977,12 +8005,12 @@ export class Databases { const collectionId = params.collectionId; const queries = params.queries; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -8099,17 +8127,17 @@ export class Databases { const documentId = params.documentId; const queries = params.queries; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof documentId === 'undefined') { + if (typeof documentId === 'undefined' || documentId === '') { throw new AppwriteException( 'Missing required parameter: "documentId"', ); @@ -8265,17 +8293,17 @@ export class Databases { const data = params.data; const permissions = params.permissions; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof documentId === 'undefined') { + if (typeof documentId === 'undefined' || documentId === '') { throw new AppwriteException( 'Missing required parameter: "documentId"', ); @@ -8435,17 +8463,17 @@ export class Databases { const data = params.data; const permissions = params.permissions; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof documentId === 'undefined') { + if (typeof documentId === 'undefined' || documentId === '') { throw new AppwriteException( 'Missing required parameter: "documentId"', ); @@ -8558,17 +8586,17 @@ export class Databases { const collectionId = params.collectionId; const documentId = params.documentId; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof documentId === 'undefined') { + if (typeof documentId === 'undefined' || documentId === '') { throw new AppwriteException( 'Missing required parameter: "documentId"', ); @@ -8593,6 +8621,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -8707,22 +8736,22 @@ export class Databases { const value = params.value; const min = params.min; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof documentId === 'undefined') { + if (typeof documentId === 'undefined' || documentId === '') { throw new AppwriteException( 'Missing required parameter: "documentId"', ); } - if (typeof attribute === 'undefined') { + if (typeof attribute === 'undefined' || attribute === '') { throw new AppwriteException( 'Missing required parameter: "attribute"', ); @@ -8866,22 +8895,22 @@ export class Databases { const value = params.value; const max = params.max; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof documentId === 'undefined') { + if (typeof documentId === 'undefined' || documentId === '') { throw new AppwriteException( 'Missing required parameter: "documentId"', ); } - if (typeof attribute === 'undefined') { + if (typeof attribute === 'undefined' || attribute === '') { throw new AppwriteException( 'Missing required parameter: "attribute"', ); @@ -8992,12 +9021,12 @@ export class Databases { const collectionId = params.collectionId; const queries = params.queries; const total = params.total; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -9138,12 +9167,12 @@ export class Databases { const attributes = params.attributes; const orders = params.orders; const lengths = params.lengths; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -9251,17 +9280,17 @@ export class Databases { const databaseId = params.databaseId; const collectionId = params.collectionId; const key = params.key; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } const apiPath = @@ -9341,17 +9370,17 @@ export class Databases { const databaseId = params.databaseId; const collectionId = params.collectionId; const key = params.key; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } const apiPath = @@ -9368,6 +9397,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); diff --git a/src/services/documents-db.ts b/src/services/documents-db.ts index 8a9eec0d..a8af65d8 100644 --- a/src/services/documents-db.ts +++ b/src/services/documents-db.ts @@ -39,7 +39,7 @@ export class DocumentsDB { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -210,7 +210,7 @@ export class DocumentsDB { } /** - * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, pricing, and whether it is enabled for the organization. + * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, its own prices and overage rates, and whether it is enabled for the organization. * * @throws {AppwriteException} * @returns {Promise} @@ -253,7 +253,7 @@ export class DocumentsDB { let params: { queries?: string[] }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -304,7 +304,7 @@ export class DocumentsDB { let params: { ttl?: number }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -370,7 +370,7 @@ export class DocumentsDB { } const transactionId = params.transactionId; - if (typeof transactionId === 'undefined') { + if (typeof transactionId === 'undefined' || transactionId === '') { throw new AppwriteException( 'Missing required parameter: "transactionId"', ); @@ -452,7 +452,7 @@ export class DocumentsDB { const transactionId = params.transactionId; const commit = params.commit; const rollback = params.rollback; - if (typeof transactionId === 'undefined') { + if (typeof transactionId === 'undefined' || transactionId === '') { throw new AppwriteException( 'Missing required parameter: "transactionId"', ); @@ -514,7 +514,7 @@ export class DocumentsDB { } const transactionId = params.transactionId; - if (typeof transactionId === 'undefined') { + if (typeof transactionId === 'undefined' || transactionId === '') { throw new AppwriteException( 'Missing required parameter: "transactionId"', ); @@ -529,6 +529,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -584,7 +585,7 @@ export class DocumentsDB { const transactionId = params.transactionId; const operations = params.operations; - if (typeof transactionId === 'undefined') { + if (typeof transactionId === 'undefined' || transactionId === '') { throw new AppwriteException( 'Missing required parameter: "transactionId"', ); @@ -644,7 +645,7 @@ export class DocumentsDB { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -757,7 +758,7 @@ export class DocumentsDB { const specification = params.specification; const replicas = params.replicas; const syncMode = params.syncMode; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -829,7 +830,7 @@ export class DocumentsDB { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -844,6 +845,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -924,7 +926,7 @@ export class DocumentsDB { const queries = params.queries; const search = params.search; const total = params.total; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1072,7 +1074,7 @@ export class DocumentsDB { const enabled = params.enabled; const attributes = params.attributes; const indexes = params.indexes; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1171,12 +1173,12 @@ export class DocumentsDB { const databaseId = params.databaseId; const collectionId = params.collectionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1300,12 +1302,12 @@ export class DocumentsDB { const documentSecurity = params.documentSecurity; const enabled = params.enabled; const purge = params.purge; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1392,12 +1394,12 @@ export class DocumentsDB { const databaseId = params.databaseId; const collectionId = params.collectionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1414,6 +1416,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -1514,12 +1517,12 @@ export class DocumentsDB { const transactionId = params.transactionId; const total = params.total; const ttl = params.ttl; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1674,12 +1677,12 @@ export class DocumentsDB { const data = params.data; const permissions = params.permissions; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1800,12 +1803,12 @@ export class DocumentsDB { const collectionId = params.collectionId; const documents = params.documents; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1919,12 +1922,12 @@ export class DocumentsDB { const collectionId = params.collectionId; const documents = params.documents; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -2045,12 +2048,12 @@ export class DocumentsDB { const data = params.data; const queries = params.queries; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -2160,12 +2163,12 @@ export class DocumentsDB { const collectionId = params.collectionId; const queries = params.queries; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -2281,17 +2284,17 @@ export class DocumentsDB { const documentId = params.documentId; const queries = params.queries; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof documentId === 'undefined') { + if (typeof documentId === 'undefined' || documentId === '') { throw new AppwriteException( 'Missing required parameter: "documentId"', ); @@ -2446,17 +2449,17 @@ export class DocumentsDB { const data = params.data; const permissions = params.permissions; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof documentId === 'undefined') { + if (typeof documentId === 'undefined' || documentId === '') { throw new AppwriteException( 'Missing required parameter: "documentId"', ); @@ -2615,17 +2618,17 @@ export class DocumentsDB { const data = params.data; const permissions = params.permissions; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof documentId === 'undefined') { + if (typeof documentId === 'undefined' || documentId === '') { throw new AppwriteException( 'Missing required parameter: "documentId"', ); @@ -2737,17 +2740,17 @@ export class DocumentsDB { const collectionId = params.collectionId; const documentId = params.documentId; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof documentId === 'undefined') { + if (typeof documentId === 'undefined' || documentId === '') { throw new AppwriteException( 'Missing required parameter: "documentId"', ); @@ -2772,6 +2775,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -2885,22 +2889,22 @@ export class DocumentsDB { const value = params.value; const min = params.min; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof documentId === 'undefined') { + if (typeof documentId === 'undefined' || documentId === '') { throw new AppwriteException( 'Missing required parameter: "documentId"', ); } - if (typeof attribute === 'undefined') { + if (typeof attribute === 'undefined' || attribute === '') { throw new AppwriteException( 'Missing required parameter: "attribute"', ); @@ -3043,22 +3047,22 @@ export class DocumentsDB { const value = params.value; const max = params.max; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof documentId === 'undefined') { + if (typeof documentId === 'undefined' || documentId === '') { throw new AppwriteException( 'Missing required parameter: "documentId"', ); } - if (typeof attribute === 'undefined') { + if (typeof attribute === 'undefined' || attribute === '') { throw new AppwriteException( 'Missing required parameter: "attribute"', ); @@ -3168,12 +3172,12 @@ export class DocumentsDB { const collectionId = params.collectionId; const queries = params.queries; const total = params.total; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -3313,12 +3317,12 @@ export class DocumentsDB { const attributes = params.attributes; const orders = params.orders; const lengths = params.lengths; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -3425,17 +3429,17 @@ export class DocumentsDB { const databaseId = params.databaseId; const collectionId = params.collectionId; const key = params.key; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } const apiPath = @@ -3514,17 +3518,17 @@ export class DocumentsDB { const databaseId = params.databaseId; const collectionId = params.collectionId; const key = params.key; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } const apiPath = @@ -3541,6 +3545,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -3596,7 +3601,7 @@ export class DocumentsDB { const databaseId = params.databaseId; const targetReplicaId = params.targetReplicaId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -3695,7 +3700,7 @@ export class DocumentsDB { const status = params.status; const limit = params.limit; const offset = params.offset; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -3761,7 +3766,7 @@ export class DocumentsDB { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -3816,7 +3821,7 @@ export class DocumentsDB { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); diff --git a/src/services/domains.ts b/src/services/domains.ts new file mode 100644 index 00000000..910dcb1c --- /dev/null +++ b/src/services/domains.ts @@ -0,0 +1,4647 @@ +import { AppwriteException, Client, type Payload } from '../client'; +import type { Models } from '../models'; + +import { DomainRegistrationType } from '../enums/domain-registration-type'; +export class Domains { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + /** + * List all domains registered for this project. This endpoint supports pagination. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as domain name, teamInternalId, expiration, etc. + * @param {string} params.search - Search term to filter your list results. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + list(params?: { + queries?: string[]; + search?: string; + }): Promise; + /** + * List all domains registered for this project. This endpoint supports pagination. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as domain name, teamInternalId, expiration, etc. + * @param {string} search - Search term to filter your list results. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + list(queries?: string[], search?: string): Promise; + list( + paramsOrFirst?: { queries?: string[]; search?: string } | string[], + ...rest: [string?] + ): Promise { + let params: { queries?: string[]; search?: string }; + + if ( + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { + params = (paramsOrFirst || {}) as { + queries?: string[]; + search?: string; + }; + } else { + params = { + queries: paramsOrFirst as string[], + search: rest[0] as string, + }; + } + + const queries = params.queries; + const search = params.search; + const apiPath = '/domains'; + const apiPayload: Payload = {}; + if (typeof queries !== 'undefined') { + apiPayload['queries'] = queries; + } + if (typeof search !== 'undefined') { + apiPayload['search'] = search; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }; + + return this.client.call('get', uri, apiHeaders, apiPayload); + } + + /** + * Create a new domain. Before creating a domain, you need to ensure that your DNS provider is properly configured. After creating the domain, you can use the verification endpoint to check if the domain is ready to be used. + * + * @param {string} params.teamId - Team unique ID. + * @param {string} params.domain - Domain name (e.g. "example.com"). + * @throws {AppwriteException} + * @returns {Promise} + */ + create(params: { teamId: string; domain: string }): Promise; + /** + * Create a new domain. Before creating a domain, you need to ensure that your DNS provider is properly configured. After creating the domain, you can use the verification endpoint to check if the domain is ready to be used. + * + * @param {string} teamId - Team unique ID. + * @param {string} domain - Domain name (e.g. "example.com"). + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + create(teamId: string, domain: string): Promise; + create( + paramsOrFirst: { teamId: string; domain: string } | string, + ...rest: [string?] + ): Promise { + let params: { teamId: string; domain: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + teamId: string; + domain: string; + }; + } else { + params = { + teamId: paramsOrFirst as string, + domain: rest[0] as string, + }; + } + + const teamId = params.teamId; + const domain = params.domain; + if (typeof teamId === 'undefined') { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + if (typeof domain === 'undefined') { + throw new AppwriteException('Missing required parameter: "domain"'); + } + const apiPath = '/domains'; + const apiPayload: Payload = {}; + if (typeof teamId !== 'undefined') { + apiPayload['teamId'] = teamId; + } + if (typeof domain !== 'undefined') { + apiPayload['domain'] = domain; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * Get the registration price for a domain name. + * + * @param {string} params.domain - Domain name to get price for. + * @param {number} params.periodYears - Number of years to calculate the domain price for. Must be at least 1. + * @param {DomainRegistrationType} params.registrationType - Type of registration pricing to fetch. Allowed values: new, transfer, renewal, trade. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated This API has been deprecated since 2.0.0. Please use `Domains.listPrices` instead. + */ + getPrice(params: { + domain: string; + periodYears?: number; + registrationType?: DomainRegistrationType; + }): Promise; + /** + * Get the registration price for a domain name. + * + * @param {string} domain - Domain name to get price for. + * @param {number} periodYears - Number of years to calculate the domain price for. Must be at least 1. + * @param {DomainRegistrationType} registrationType - Type of registration pricing to fetch. Allowed values: new, transfer, renewal, trade. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getPrice( + domain: string, + periodYears?: number, + registrationType?: DomainRegistrationType, + ): Promise; + getPrice( + paramsOrFirst: + | { + domain: string; + periodYears?: number; + registrationType?: DomainRegistrationType; + } + | string, + ...rest: [number?, DomainRegistrationType?] + ): Promise { + let params: { + domain: string; + periodYears?: number; + registrationType?: DomainRegistrationType; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domain: string; + periodYears?: number; + registrationType?: DomainRegistrationType; + }; + } else { + params = { + domain: paramsOrFirst as string, + periodYears: rest[0] as number, + registrationType: rest[1] as DomainRegistrationType, + }; + } + + const domain = params.domain; + const periodYears = params.periodYears; + const registrationType = params.registrationType; + if (typeof domain === 'undefined') { + throw new AppwriteException('Missing required parameter: "domain"'); + } + const apiPath = '/domains/price'; + const apiPayload: Payload = {}; + if (typeof domain !== 'undefined') { + apiPayload['domain'] = domain; + } + if (typeof periodYears !== 'undefined') { + apiPayload['periodYears'] = periodYears; + } + if (typeof registrationType !== 'undefined') { + apiPayload['registrationType'] = registrationType; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }; + + return this.client.call('get', uri, apiHeaders, apiPayload); + } + + /** + * Check availability and get the requested registration price for one or more domain names. Availability is resolved for all domains in a single registrar lookup. Unavailable domains have a null price for new registrations, but can still be priced for renewal, transfer, or trade. Every priced domain also carries its renewal price for the same period, so a separate renewal lookup is not needed. A domain whose price could not be resolved, for example because its TLD is not supported, is returned with a null price. + * + * @param {string[]} params.domains - Domain names to check availability and price for. Maximum of 50 domains per request. + * @param {number} params.periodYears - Number of years to calculate the domain price for. Must be at least 1. + * @param {DomainRegistrationType} params.registrationType - Type of registration pricing to fetch. Allowed values: new, transfer, renewal, trade. + * @throws {AppwriteException} + * @returns {Promise} + */ + listPrices(params: { + domains: string[]; + periodYears?: number; + registrationType?: DomainRegistrationType; + }): Promise; + /** + * Check availability and get the requested registration price for one or more domain names. Availability is resolved for all domains in a single registrar lookup. Unavailable domains have a null price for new registrations, but can still be priced for renewal, transfer, or trade. Every priced domain also carries its renewal price for the same period, so a separate renewal lookup is not needed. A domain whose price could not be resolved, for example because its TLD is not supported, is returned with a null price. + * + * @param {string[]} domains - Domain names to check availability and price for. Maximum of 50 domains per request. + * @param {number} periodYears - Number of years to calculate the domain price for. Must be at least 1. + * @param {DomainRegistrationType} registrationType - Type of registration pricing to fetch. Allowed values: new, transfer, renewal, trade. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listPrices( + domains: string[], + periodYears?: number, + registrationType?: DomainRegistrationType, + ): Promise; + listPrices( + paramsOrFirst: + | { + domains: string[]; + periodYears?: number; + registrationType?: DomainRegistrationType; + } + | string[], + ...rest: [number?, DomainRegistrationType?] + ): Promise { + let params: { + domains: string[]; + periodYears?: number; + registrationType?: DomainRegistrationType; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domains: string[]; + periodYears?: number; + registrationType?: DomainRegistrationType; + }; + } else { + params = { + domains: paramsOrFirst as string[], + periodYears: rest[0] as number, + registrationType: rest[1] as DomainRegistrationType, + }; + } + + const domains = params.domains; + const periodYears = params.periodYears; + const registrationType = params.registrationType; + if (typeof domains === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "domains"', + ); + } + const apiPath = '/domains/prices'; + const apiPayload: Payload = {}; + if (typeof domains !== 'undefined') { + apiPayload['domains'] = domains; + } + if (typeof periodYears !== 'undefined') { + apiPayload['periodYears'] = periodYears; + } + if (typeof registrationType !== 'undefined') { + apiPayload['registrationType'] = registrationType; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }; + + return this.client.call('get', uri, apiHeaders, apiPayload); + } + + /** + * Get a domain by its unique ID. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + get(params: { domainId: string }): Promise; + /** + * Get a domain by its unique ID. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + get(domainId: string): Promise; + get(paramsOrFirst: { domainId: string } | string): Promise { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }; + + return this.client.call('get', uri, apiHeaders, apiPayload); + } + + /** + * Delete a domain by its unique ID. This endpoint can be used to delete a domain from your project. + * Once deleted, the domain will no longer be available for use and all associated resources will be removed. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + delete(params: { domainId: string }): Promise<{}>; + /** + * Delete a domain by its unique ID. This endpoint can be used to delete a domain from your project. + * Once deleted, the domain will no longer be available for use and all associated resources will be removed. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + delete(domainId: string): Promise<{}>; + delete(paramsOrFirst: { domainId: string } | string): Promise<{}> { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('delete', uri, apiHeaders, apiPayload); + } + + /** + * Update the registrar nameservers for the given domain. When nameservers are not provided, + * the domain will be updated to use Appwrite nameservers. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string[]} params.nameservers - Nameservers to set for the domain. Defaults to Appwrite nameservers when omitted. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateNameservers(params: { + domainId: string; + nameservers?: string[]; + }): Promise; + /** + * Update the registrar nameservers for the given domain. When nameservers are not provided, + * the domain will be updated to use Appwrite nameservers. + * + * @param {string} domainId - Domain unique ID. + * @param {string[]} nameservers - Nameservers to set for the domain. Defaults to Appwrite nameservers when omitted. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateNameservers( + domainId: string, + nameservers?: string[], + ): Promise; + updateNameservers( + paramsOrFirst: { domainId: string; nameservers?: string[] } | string, + ...rest: [string[]?] + ): Promise { + let params: { domainId: string; nameservers?: string[] }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + nameservers?: string[]; + }; + } else { + params = { + domainId: paramsOrFirst as string, + nameservers: rest[0] as string[], + }; + } + + const domainId = params.domainId; + const nameservers = params.nameservers; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/nameservers'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + if (typeof nameservers !== 'undefined') { + apiPayload['nameservers'] = nameservers; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('patch', uri, apiHeaders, apiPayload); + } + + /** + * Verify which NS records are used and update the domain accordingly. This will check the domain's + * nameservers and update the domain's status based on whether the nameservers match the expected + * Appwrite nameservers. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + verifyNameservers(params: { domainId: string }): Promise; + /** + * Verify which NS records are used and update the domain accordingly. This will check the domain's + * nameservers and update the domain's status based on whether the nameservers match the expected + * Appwrite nameservers. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + verifyNameservers(domainId: string): Promise; + verifyNameservers( + paramsOrFirst: { domainId: string } | string, + ): Promise { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/nameservers/verification'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('patch', uri, apiHeaders, apiPayload); + } + + /** + * List Google Workspace DNS records. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getPresetGoogleWorkspace(params: { + domainId: string; + }): Promise; + /** + * List Google Workspace DNS records. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getPresetGoogleWorkspace(domainId: string): Promise; + getPresetGoogleWorkspace( + paramsOrFirst: { domainId: string } | string, + ): Promise { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/presets/google-workspace'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }; + + return this.client.call('get', uri, apiHeaders, apiPayload); + } + + /** + * Add Google Workspace DNS records to the domain. This will create the required MX records + * for Google Workspace email hosting. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + createPresetGoogleWorkspace(params: { + domainId: string; + }): Promise; + /** + * Add Google Workspace DNS records to the domain. This will create the required MX records + * for Google Workspace email hosting. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createPresetGoogleWorkspace( + domainId: string, + ): Promise; + createPresetGoogleWorkspace( + paramsOrFirst: { domainId: string } | string, + ): Promise { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/presets/google-workspace'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * List iCloud DNS records. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getPresetICloud(params: { + domainId: string; + }): Promise; + /** + * List iCloud DNS records. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getPresetICloud(domainId: string): Promise; + getPresetICloud( + paramsOrFirst: { domainId: string } | string, + ): Promise { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/presets/icloud'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }; + + return this.client.call('get', uri, apiHeaders, apiPayload); + } + + /** + * Add iCloud DNS records to the domain. This will create the required MX and SPF records + * for using iCloud email services with your domain. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + createPresetICloud(params: { + domainId: string; + }): Promise; + /** + * Add iCloud DNS records to the domain. This will create the required MX and SPF records + * for using iCloud email services with your domain. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createPresetICloud(domainId: string): Promise; + createPresetICloud( + paramsOrFirst: { domainId: string } | string, + ): Promise { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/presets/icloud'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * List Mailgun DNS records. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getPresetMailgun(params: { + domainId: string; + }): Promise; + /** + * List Mailgun DNS records. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getPresetMailgun(domainId: string): Promise; + getPresetMailgun( + paramsOrFirst: { domainId: string } | string, + ): Promise { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/presets/mailgun'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }; + + return this.client.call('get', uri, apiHeaders, apiPayload); + } + + /** + * Add Mailgun DNS records to the domain. This endpoint will create the required DNS records + * for Mailgun in the specified domain. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + createPresetMailgun(params: { + domainId: string; + }): Promise; + /** + * Add Mailgun DNS records to the domain. This endpoint will create the required DNS records + * for Mailgun in the specified domain. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createPresetMailgun(domainId: string): Promise; + createPresetMailgun( + paramsOrFirst: { domainId: string } | string, + ): Promise { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/presets/mailgun'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * List Outlook DNS records. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getPresetOutlook(params: { + domainId: string; + }): Promise; + /** + * List Outlook DNS records. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getPresetOutlook(domainId: string): Promise; + getPresetOutlook( + paramsOrFirst: { domainId: string } | string, + ): Promise { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/presets/outlook'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }; + + return this.client.call('get', uri, apiHeaders, apiPayload); + } + + /** + * Add Outlook DNS records to the domain. This will create the required MX records + * for setting up Outlook email hosting for your domain. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + createPresetOutlook(params: { + domainId: string; + }): Promise; + /** + * Add Outlook DNS records to the domain. This will create the required MX records + * for setting up Outlook email hosting for your domain. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createPresetOutlook(domainId: string): Promise; + createPresetOutlook( + paramsOrFirst: { domainId: string } | string, + ): Promise { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/presets/outlook'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * List ProtonMail DNS records. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getPresetProtonMail(params: { + domainId: string; + }): Promise; + /** + * List ProtonMail DNS records. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getPresetProtonMail(domainId: string): Promise; + getPresetProtonMail( + paramsOrFirst: { domainId: string } | string, + ): Promise { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/presets/proton-mail'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }; + + return this.client.call('get', uri, apiHeaders, apiPayload); + } + + /** + * Add ProtonMail DNS records to the domain. This will create the required MX records + * for using ProtonMail with your custom domain. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + createPresetProtonMail(params: { + domainId: string; + }): Promise; + /** + * Add ProtonMail DNS records to the domain. This will create the required MX records + * for using ProtonMail with your custom domain. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createPresetProtonMail(domainId: string): Promise; + createPresetProtonMail( + paramsOrFirst: { domainId: string } | string, + ): Promise { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/presets/proton-mail'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * List Zoho DNS records. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getPresetZoho(params: { domainId: string }): Promise; + /** + * List Zoho DNS records. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getPresetZoho(domainId: string): Promise; + getPresetZoho( + paramsOrFirst: { domainId: string } | string, + ): Promise { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/presets/zoho'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }; + + return this.client.call('get', uri, apiHeaders, apiPayload); + } + + /** + * Add Zoho Mail DNS records to the domain. This will create the required MX records + * for setting up Zoho Mail on your domain. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + createPresetZoho(params: { + domainId: string; + }): Promise; + /** + * Add Zoho Mail DNS records to the domain. This will create the required MX records + * for setting up Zoho Mail on your domain. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createPresetZoho(domainId: string): Promise; + createPresetZoho( + paramsOrFirst: { domainId: string } | string, + ): Promise { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/presets/zoho'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * List DNS records for a given domain. You can use this endpoint to list all the DNS records + * associated with your domain. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. You may filter on attributes such as type, name, value, etc. Maximum of 100 queries are allowed, each 4096 characters long. + * @throws {AppwriteException} + * @returns {Promise} + */ + listRecords(params: { + domainId: string; + queries?: string[]; + }): Promise; + /** + * List DNS records for a given domain. You can use this endpoint to list all the DNS records + * associated with your domain. + * + * @param {string} domainId - Domain unique ID. + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. You may filter on attributes such as type, name, value, etc. Maximum of 100 queries are allowed, each 4096 characters long. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listRecords( + domainId: string, + queries?: string[], + ): Promise; + listRecords( + paramsOrFirst: { domainId: string; queries?: string[] } | string, + ...rest: [string[]?] + ): Promise { + let params: { domainId: string; queries?: string[] }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + queries?: string[]; + }; + } else { + params = { + domainId: paramsOrFirst as string, + queries: rest[0] as string[], + }; + } + + const domainId = params.domainId; + const queries = params.queries; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/records'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + if (typeof queries !== 'undefined') { + apiPayload['queries'] = queries; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }; + + return this.client.call('get', uri, apiHeaders, apiPayload); + } + + /** + * Create a new A record for the given domain. A records are used to point a domain name + * to an IPv4 address. The record value should be a valid IPv4 address. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.name - Record name (subdomain). + * @param {string} params.value - IPv4 address for this A record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} params.comment - A comment explaining what this record is for. + * @throws {AppwriteException} + * @returns {Promise} + */ + createRecordA(params: { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }): Promise; + /** + * Create a new A record for the given domain. A records are used to point a domain name + * to an IPv4 address. The record value should be a valid IPv4 address. + * + * @param {string} domainId - Domain unique ID. + * @param {string} name - Record name (subdomain). + * @param {string} value - IPv4 address for this A record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} comment - A comment explaining what this record is for. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createRecordA( + domainId: string, + name: string, + value: string, + ttl: number, + comment?: string, + ): Promise; + createRecordA( + paramsOrFirst: + | { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + } + | string, + ...rest: [string?, string?, number?, string?] + ): Promise { + let params: { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + name: rest[0] as string, + value: rest[1] as string, + ttl: rest[2] as number, + comment: rest[3] as string, + }; + } + + const domainId = params.domainId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + const apiPath = '/domains/{domainId}/records/a'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * Update an existing A record for the given domain. This endpoint allows you to modify + * the properties of an A record including its name (subdomain), IPv4 address, TTL, + * and optional comment. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.recordId - DNS record unique ID. + * @param {string} params.name - Record name (subdomain). + * @param {string} params.value - IPv4 address for this A record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} params.comment - A comment explaining what this record is for. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateRecordA(params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }): Promise; + /** + * Update an existing A record for the given domain. This endpoint allows you to modify + * the properties of an A record including its name (subdomain), IPv4 address, TTL, + * and optional comment. + * + * @param {string} domainId - Domain unique ID. + * @param {string} recordId - DNS record unique ID. + * @param {string} name - Record name (subdomain). + * @param {string} value - IPv4 address for this A record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} comment - A comment explaining what this record is for. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateRecordA( + domainId: string, + recordId: string, + name: string, + value: string, + ttl: number, + comment?: string, + ): Promise; + updateRecordA( + paramsOrFirst: + | { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + } + | string, + ...rest: [string?, string?, string?, number?, string?] + ): Promise { + let params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + recordId: rest[0] as string, + name: rest[1] as string, + value: rest[2] as string, + ttl: rest[3] as number, + comment: rest[4] as string, + }; + } + + const domainId = params.domainId; + const recordId = params.recordId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof recordId === 'undefined' || recordId === '') { + throw new AppwriteException( + 'Missing required parameter: "recordId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + const apiPath = '/domains/{domainId}/records/a/{recordId}' + .replace('{domainId}', encodeURIComponent(String(domainId))) + .replace('{recordId}', encodeURIComponent(String(recordId))); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('put', uri, apiHeaders, apiPayload); + } + + /** + * Create a new AAAA record for the given domain. This endpoint allows you to add a new IPv6 DNS record + * to your domain. The record will be used to point a hostname to an IPv6 address. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.name - Record name (subdomain). + * @param {string} params.value - IPv6 address for this AAAA record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} params.comment - A comment explaining what this record is for. + * @throws {AppwriteException} + * @returns {Promise} + */ + createRecordAAAA(params: { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }): Promise; + /** + * Create a new AAAA record for the given domain. This endpoint allows you to add a new IPv6 DNS record + * to your domain. The record will be used to point a hostname to an IPv6 address. + * + * @param {string} domainId - Domain unique ID. + * @param {string} name - Record name (subdomain). + * @param {string} value - IPv6 address for this AAAA record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} comment - A comment explaining what this record is for. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createRecordAAAA( + domainId: string, + name: string, + value: string, + ttl: number, + comment?: string, + ): Promise; + createRecordAAAA( + paramsOrFirst: + | { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + } + | string, + ...rest: [string?, string?, number?, string?] + ): Promise { + let params: { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + name: rest[0] as string, + value: rest[1] as string, + ttl: rest[2] as number, + comment: rest[3] as string, + }; + } + + const domainId = params.domainId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + const apiPath = '/domains/{domainId}/records/aaaa'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * Update an existing AAAA record for the given domain. This endpoint allows you to modify + * the properties of an existing AAAA record, including its name (subdomain), IPv6 address, + * TTL, and optional comment. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.recordId - DNS record unique ID. + * @param {string} params.name - Record name (subdomain). + * @param {string} params.value - IPv6 address for this AAAA record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateRecordAAAA(params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }): Promise; + /** + * Update an existing AAAA record for the given domain. This endpoint allows you to modify + * the properties of an existing AAAA record, including its name (subdomain), IPv6 address, + * TTL, and optional comment. + * + * @param {string} domainId - Domain unique ID. + * @param {string} recordId - DNS record unique ID. + * @param {string} name - Record name (subdomain). + * @param {string} value - IPv6 address for this AAAA record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateRecordAAAA( + domainId: string, + recordId: string, + name: string, + value: string, + ttl: number, + comment?: string, + ): Promise; + updateRecordAAAA( + paramsOrFirst: + | { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + } + | string, + ...rest: [string?, string?, string?, number?, string?] + ): Promise { + let params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + recordId: rest[0] as string, + name: rest[1] as string, + value: rest[2] as string, + ttl: rest[3] as number, + comment: rest[4] as string, + }; + } + + const domainId = params.domainId; + const recordId = params.recordId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof recordId === 'undefined' || recordId === '') { + throw new AppwriteException( + 'Missing required parameter: "recordId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + const apiPath = '/domains/{domainId}/records/aaaa/{recordId}' + .replace('{domainId}', encodeURIComponent(String(domainId))) + .replace('{recordId}', encodeURIComponent(String(recordId))); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('put', uri, apiHeaders, apiPayload); + } + + /** + * Create a new ALIAS record for the given domain. This record type can be used to point your domain + * to another domain name that will serve as an alias. This is particularly useful when you want to + * map your domain to a target domain that may change its IP address. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.name - Record name. + * @param {string} params.value - Target domain for this ALIAS record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + createRecordAlias(params: { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }): Promise; + /** + * Create a new ALIAS record for the given domain. This record type can be used to point your domain + * to another domain name that will serve as an alias. This is particularly useful when you want to + * map your domain to a target domain that may change its IP address. + * + * @param {string} domainId - Domain unique ID. + * @param {string} name - Record name. + * @param {string} value - Target domain for this ALIAS record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createRecordAlias( + domainId: string, + name: string, + value: string, + ttl: number, + comment?: string, + ): Promise; + createRecordAlias( + paramsOrFirst: + | { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + } + | string, + ...rest: [string?, string?, number?, string?] + ): Promise { + let params: { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + name: rest[0] as string, + value: rest[1] as string, + ttl: rest[2] as number, + comment: rest[3] as string, + }; + } + + const domainId = params.domainId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + const apiPath = '/domains/{domainId}/records/alias'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * Update an existing ALIAS record for the specified domain. This endpoint allows you to modify + * the properties of an existing ALIAS record including its name, target domain, TTL, and comment. + * + * The ALIAS record type is similar to a CNAME record but can be used at the zone apex (root domain). + * It provides a way to map one domain name to another. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.recordId - DNS record unique ID. + * @param {string} params.name - Record name. + * @param {string} params.value - Target domain for this ALIAS record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateRecordAlias(params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }): Promise; + /** + * Update an existing ALIAS record for the specified domain. This endpoint allows you to modify + * the properties of an existing ALIAS record including its name, target domain, TTL, and comment. + * + * The ALIAS record type is similar to a CNAME record but can be used at the zone apex (root domain). + * It provides a way to map one domain name to another. + * + * @param {string} domainId - Domain unique ID. + * @param {string} recordId - DNS record unique ID. + * @param {string} name - Record name. + * @param {string} value - Target domain for this ALIAS record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateRecordAlias( + domainId: string, + recordId: string, + name: string, + value: string, + ttl: number, + comment?: string, + ): Promise; + updateRecordAlias( + paramsOrFirst: + | { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + } + | string, + ...rest: [string?, string?, string?, number?, string?] + ): Promise { + let params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + recordId: rest[0] as string, + name: rest[1] as string, + value: rest[2] as string, + ttl: rest[3] as number, + comment: rest[4] as string, + }; + } + + const domainId = params.domainId; + const recordId = params.recordId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof recordId === 'undefined' || recordId === '') { + throw new AppwriteException( + 'Missing required parameter: "recordId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + const apiPath = '/domains/{domainId}/records/alias/{recordId}' + .replace('{domainId}', encodeURIComponent(String(domainId))) + .replace('{recordId}', encodeURIComponent(String(recordId))); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('put', uri, apiHeaders, apiPayload); + } + + /** + * Create a new CAA record for the given domain. CAA records are used to specify which + * Certificate Authorities (CAs) are allowed to issue SSL/TLS certificates for your domain. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.name - Record name. + * @param {string} params.value - CAA value (e.g. issuer domain). + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + createRecordCAA(params: { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }): Promise; + /** + * Create a new CAA record for the given domain. CAA records are used to specify which + * Certificate Authorities (CAs) are allowed to issue SSL/TLS certificates for your domain. + * + * @param {string} domainId - Domain unique ID. + * @param {string} name - Record name. + * @param {string} value - CAA value (e.g. issuer domain). + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createRecordCAA( + domainId: string, + name: string, + value: string, + ttl: number, + comment?: string, + ): Promise; + createRecordCAA( + paramsOrFirst: + | { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + } + | string, + ...rest: [string?, string?, number?, string?] + ): Promise { + let params: { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + name: rest[0] as string, + value: rest[1] as string, + ttl: rest[2] as number, + comment: rest[3] as string, + }; + } + + const domainId = params.domainId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + const apiPath = '/domains/{domainId}/records/caa'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * Update an existing CAA record for the given domain. A CAA (Certification Authority Authorization) + * record is used to specify which certificate authorities (CAs) are authorized to issue certificates + * for a domain. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.recordId - DNS record unique ID. + * @param {string} params.name - Record name. + * @param {string} params.value - CAA value (e.g. issuer domain). + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateRecordCAA(params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }): Promise; + /** + * Update an existing CAA record for the given domain. A CAA (Certification Authority Authorization) + * record is used to specify which certificate authorities (CAs) are authorized to issue certificates + * for a domain. + * + * @param {string} domainId - Domain unique ID. + * @param {string} recordId - DNS record unique ID. + * @param {string} name - Record name. + * @param {string} value - CAA value (e.g. issuer domain). + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateRecordCAA( + domainId: string, + recordId: string, + name: string, + value: string, + ttl: number, + comment?: string, + ): Promise; + updateRecordCAA( + paramsOrFirst: + | { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + } + | string, + ...rest: [string?, string?, string?, number?, string?] + ): Promise { + let params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + recordId: rest[0] as string, + name: rest[1] as string, + value: rest[2] as string, + ttl: rest[3] as number, + comment: rest[4] as string, + }; + } + + const domainId = params.domainId; + const recordId = params.recordId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof recordId === 'undefined' || recordId === '') { + throw new AppwriteException( + 'Missing required parameter: "recordId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + const apiPath = '/domains/{domainId}/records/caa/{recordId}' + .replace('{domainId}', encodeURIComponent(String(domainId))) + .replace('{recordId}', encodeURIComponent(String(recordId))); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('put', uri, apiHeaders, apiPayload); + } + + /** + * Create a new CNAME record for the given domain. + * + * A CNAME record maps a subdomain to another domain name, allowing you to create aliases + * for your domain. For example, you can create a CNAME record to point 'blog.example.com' + * to 'example.wordpress.com'. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.name - Record name (subdomain). + * @param {string} params.value - Canonical target for this CNAME record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + createRecordCNAME(params: { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }): Promise; + /** + * Create a new CNAME record for the given domain. + * + * A CNAME record maps a subdomain to another domain name, allowing you to create aliases + * for your domain. For example, you can create a CNAME record to point 'blog.example.com' + * to 'example.wordpress.com'. + * + * @param {string} domainId - Domain unique ID. + * @param {string} name - Record name (subdomain). + * @param {string} value - Canonical target for this CNAME record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createRecordCNAME( + domainId: string, + name: string, + value: string, + ttl: number, + comment?: string, + ): Promise; + createRecordCNAME( + paramsOrFirst: + | { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + } + | string, + ...rest: [string?, string?, number?, string?] + ): Promise { + let params: { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + name: rest[0] as string, + value: rest[1] as string, + ttl: rest[2] as number, + comment: rest[3] as string, + }; + } + + const domainId = params.domainId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + const apiPath = '/domains/{domainId}/records/cname'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * Update an existing CNAME record for the given domain. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.recordId - DNS record unique ID. + * @param {string} params.name - Record name (subdomain). + * @param {string} params.value - Canonical target for this CNAME record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateRecordCNAME(params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }): Promise; + /** + * Update an existing CNAME record for the given domain. + * + * @param {string} domainId - Domain unique ID. + * @param {string} recordId - DNS record unique ID. + * @param {string} name - Record name (subdomain). + * @param {string} value - Canonical target for this CNAME record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateRecordCNAME( + domainId: string, + recordId: string, + name: string, + value: string, + ttl: number, + comment?: string, + ): Promise; + updateRecordCNAME( + paramsOrFirst: + | { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + } + | string, + ...rest: [string?, string?, string?, number?, string?] + ): Promise { + let params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + recordId: rest[0] as string, + name: rest[1] as string, + value: rest[2] as string, + ttl: rest[3] as number, + comment: rest[4] as string, + }; + } + + const domainId = params.domainId; + const recordId = params.recordId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof recordId === 'undefined' || recordId === '') { + throw new AppwriteException( + 'Missing required parameter: "recordId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + const apiPath = '/domains/{domainId}/records/cname/{recordId}' + .replace('{domainId}', encodeURIComponent(String(domainId))) + .replace('{recordId}', encodeURIComponent(String(recordId))); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('put', uri, apiHeaders, apiPayload); + } + + /** + * Create a new HTTPS record for the given domain. This record is used to configure HTTPS + * settings for your domain, enabling secure communication over SSL/TLS. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.name - Record name (subdomain). + * @param {string} params.value - Target for the HTTPS record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + createRecordHTTPS(params: { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }): Promise; + /** + * Create a new HTTPS record for the given domain. This record is used to configure HTTPS + * settings for your domain, enabling secure communication over SSL/TLS. + * + * @param {string} domainId - Domain unique ID. + * @param {string} name - Record name (subdomain). + * @param {string} value - Target for the HTTPS record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createRecordHTTPS( + domainId: string, + name: string, + value: string, + ttl: number, + comment?: string, + ): Promise; + createRecordHTTPS( + paramsOrFirst: + | { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + } + | string, + ...rest: [string?, string?, number?, string?] + ): Promise { + let params: { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + name: rest[0] as string, + value: rest[1] as string, + ttl: rest[2] as number, + comment: rest[3] as string, + }; + } + + const domainId = params.domainId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + const apiPath = '/domains/{domainId}/records/https'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * Update an existing HTTPS record for the given domain. This endpoint allows you to modify + * the properties of an HTTPS record associated with your domain, including the name (subdomain), + * target value, TTL, and optional comment. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.recordId - DNS record unique ID. + * @param {string} params.name - Record name (subdomain). + * @param {string} params.value - Target for the HTTPS record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateRecordHTTPS(params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }): Promise; + /** + * Update an existing HTTPS record for the given domain. This endpoint allows you to modify + * the properties of an HTTPS record associated with your domain, including the name (subdomain), + * target value, TTL, and optional comment. + * + * @param {string} domainId - Domain unique ID. + * @param {string} recordId - DNS record unique ID. + * @param {string} name - Record name (subdomain). + * @param {string} value - Target for the HTTPS record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateRecordHTTPS( + domainId: string, + recordId: string, + name: string, + value: string, + ttl: number, + comment?: string, + ): Promise; + updateRecordHTTPS( + paramsOrFirst: + | { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + } + | string, + ...rest: [string?, string?, string?, number?, string?] + ): Promise { + let params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + recordId: rest[0] as string, + name: rest[1] as string, + value: rest[2] as string, + ttl: rest[3] as number, + comment: rest[4] as string, + }; + } + + const domainId = params.domainId; + const recordId = params.recordId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof recordId === 'undefined' || recordId === '') { + throw new AppwriteException( + 'Missing required parameter: "recordId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + const apiPath = '/domains/{domainId}/records/https/{recordId}' + .replace('{domainId}', encodeURIComponent(String(domainId))) + .replace('{recordId}', encodeURIComponent(String(recordId))); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('put', uri, apiHeaders, apiPayload); + } + + /** + * Create a new MX record for the given domain. MX records are used to define the mail servers responsible + * for accepting email messages for the domain. Multiple MX records can be created with different priorities. + * The priority parameter determines the order in which mail servers are used, with lower values indicating + * higher priority. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.name - Record name (subdomain). + * @param {string} params.value - Mail server domain for this MX record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {number} params.priority - MX priority. Lower values are tried first. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + createRecordMX(params: { + domainId: string; + name: string; + value: string; + ttl: number; + priority: number; + comment?: string; + }): Promise; + /** + * Create a new MX record for the given domain. MX records are used to define the mail servers responsible + * for accepting email messages for the domain. Multiple MX records can be created with different priorities. + * The priority parameter determines the order in which mail servers are used, with lower values indicating + * higher priority. + * + * @param {string} domainId - Domain unique ID. + * @param {string} name - Record name (subdomain). + * @param {string} value - Mail server domain for this MX record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {number} priority - MX priority. Lower values are tried first. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createRecordMX( + domainId: string, + name: string, + value: string, + ttl: number, + priority: number, + comment?: string, + ): Promise; + createRecordMX( + paramsOrFirst: + | { + domainId: string; + name: string; + value: string; + ttl: number; + priority: number; + comment?: string; + } + | string, + ...rest: [string?, string?, number?, number?, string?] + ): Promise { + let params: { + domainId: string; + name: string; + value: string; + ttl: number; + priority: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + name: string; + value: string; + ttl: number; + priority: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + name: rest[0] as string, + value: rest[1] as string, + ttl: rest[2] as number, + priority: rest[3] as number, + comment: rest[4] as string, + }; + } + + const domainId = params.domainId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const priority = params.priority; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + if (typeof priority === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "priority"', + ); + } + const apiPath = '/domains/{domainId}/records/mx'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof priority !== 'undefined') { + apiPayload['priority'] = priority; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * Update an existing MX record for the given domain. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.recordId - DNS record unique ID. + * @param {string} params.name - Record name (subdomain). + * @param {string} params.value - Mail server domain for this MX record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {number} params.priority - MX priority. Lower values are tried first. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateRecordMX(params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + priority: number; + comment?: string; + }): Promise; + /** + * Update an existing MX record for the given domain. + * + * @param {string} domainId - Domain unique ID. + * @param {string} recordId - DNS record unique ID. + * @param {string} name - Record name (subdomain). + * @param {string} value - Mail server domain for this MX record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {number} priority - MX priority. Lower values are tried first. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateRecordMX( + domainId: string, + recordId: string, + name: string, + value: string, + ttl: number, + priority: number, + comment?: string, + ): Promise; + updateRecordMX( + paramsOrFirst: + | { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + priority: number; + comment?: string; + } + | string, + ...rest: [string?, string?, string?, number?, number?, string?] + ): Promise { + let params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + priority: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + priority: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + recordId: rest[0] as string, + name: rest[1] as string, + value: rest[2] as string, + ttl: rest[3] as number, + priority: rest[4] as number, + comment: rest[5] as string, + }; + } + + const domainId = params.domainId; + const recordId = params.recordId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const priority = params.priority; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof recordId === 'undefined' || recordId === '') { + throw new AppwriteException( + 'Missing required parameter: "recordId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + if (typeof priority === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "priority"', + ); + } + const apiPath = '/domains/{domainId}/records/mx/{recordId}' + .replace('{domainId}', encodeURIComponent(String(domainId))) + .replace('{recordId}', encodeURIComponent(String(recordId))); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof priority !== 'undefined') { + apiPayload['priority'] = priority; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('put', uri, apiHeaders, apiPayload); + } + + /** + * Create a new NS record for the given domain. NS records specify the nameservers that are used + * to resolve the domain name to IP addresses. Each domain can have multiple NS records. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.name - Record name (subdomain). + * @param {string} params.value - Nameserver target for this NS record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + createRecordNS(params: { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }): Promise; + /** + * Create a new NS record for the given domain. NS records specify the nameservers that are used + * to resolve the domain name to IP addresses. Each domain can have multiple NS records. + * + * @param {string} domainId - Domain unique ID. + * @param {string} name - Record name (subdomain). + * @param {string} value - Nameserver target for this NS record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createRecordNS( + domainId: string, + name: string, + value: string, + ttl: number, + comment?: string, + ): Promise; + createRecordNS( + paramsOrFirst: + | { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + } + | string, + ...rest: [string?, string?, number?, string?] + ): Promise { + let params: { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + name: rest[0] as string, + value: rest[1] as string, + ttl: rest[2] as number, + comment: rest[3] as string, + }; + } + + const domainId = params.domainId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + const apiPath = '/domains/{domainId}/records/ns'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * Update an existing NS record for the given domain. This endpoint allows you to modify + * the properties of an NS (nameserver) record associated with your domain. You can update + * the record name (subdomain), target nameserver value, TTL, and add or modify comments + * for better record management. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.recordId - DNS record unique ID. + * @param {string} params.name - Record name (subdomain). + * @param {string} params.value - Nameserver target for this NS record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateRecordNS(params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }): Promise; + /** + * Update an existing NS record for the given domain. This endpoint allows you to modify + * the properties of an NS (nameserver) record associated with your domain. You can update + * the record name (subdomain), target nameserver value, TTL, and add or modify comments + * for better record management. + * + * @param {string} domainId - Domain unique ID. + * @param {string} recordId - DNS record unique ID. + * @param {string} name - Record name (subdomain). + * @param {string} value - Nameserver target for this NS record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateRecordNS( + domainId: string, + recordId: string, + name: string, + value: string, + ttl: number, + comment?: string, + ): Promise; + updateRecordNS( + paramsOrFirst: + | { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + } + | string, + ...rest: [string?, string?, string?, number?, string?] + ): Promise { + let params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + recordId: rest[0] as string, + name: rest[1] as string, + value: rest[2] as string, + ttl: rest[3] as number, + comment: rest[4] as string, + }; + } + + const domainId = params.domainId; + const recordId = params.recordId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof recordId === 'undefined' || recordId === '') { + throw new AppwriteException( + 'Missing required parameter: "recordId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + const apiPath = '/domains/{domainId}/records/ns/{recordId}' + .replace('{domainId}', encodeURIComponent(String(domainId))) + .replace('{recordId}', encodeURIComponent(String(recordId))); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('put', uri, apiHeaders, apiPayload); + } + + /** + * Create a new SRV record for the given domain. SRV records are used to define the location + * of servers for specific services. For example, they can be used to specify which server + * handles a specific service like SIP or XMPP for the domain. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.name - Record name (service name). + * @param {string} params.value - Target hostname for this SRV record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {number} params.priority - Record priority. Lower values are tried first. + * @param {number} params.weight - Record weight, used to share load between targets of equal priority. + * @param {number} params.port - Port number for the service. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + createRecordSRV(params: { + domainId: string; + name: string; + value: string; + ttl: number; + priority: number; + weight: number; + port: number; + comment?: string; + }): Promise; + /** + * Create a new SRV record for the given domain. SRV records are used to define the location + * of servers for specific services. For example, they can be used to specify which server + * handles a specific service like SIP or XMPP for the domain. + * + * @param {string} domainId - Domain unique ID. + * @param {string} name - Record name (service name). + * @param {string} value - Target hostname for this SRV record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {number} priority - Record priority. Lower values are tried first. + * @param {number} weight - Record weight, used to share load between targets of equal priority. + * @param {number} port - Port number for the service. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createRecordSRV( + domainId: string, + name: string, + value: string, + ttl: number, + priority: number, + weight: number, + port: number, + comment?: string, + ): Promise; + createRecordSRV( + paramsOrFirst: + | { + domainId: string; + name: string; + value: string; + ttl: number; + priority: number; + weight: number; + port: number; + comment?: string; + } + | string, + ...rest: [string?, string?, number?, number?, number?, number?, string?] + ): Promise { + let params: { + domainId: string; + name: string; + value: string; + ttl: number; + priority: number; + weight: number; + port: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + name: string; + value: string; + ttl: number; + priority: number; + weight: number; + port: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + name: rest[0] as string, + value: rest[1] as string, + ttl: rest[2] as number, + priority: rest[3] as number, + weight: rest[4] as number, + port: rest[5] as number, + comment: rest[6] as string, + }; + } + + const domainId = params.domainId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const priority = params.priority; + const weight = params.weight; + const port = params.port; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + if (typeof priority === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "priority"', + ); + } + if (typeof weight === 'undefined') { + throw new AppwriteException('Missing required parameter: "weight"'); + } + if (typeof port === 'undefined') { + throw new AppwriteException('Missing required parameter: "port"'); + } + const apiPath = '/domains/{domainId}/records/srv'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof priority !== 'undefined') { + apiPayload['priority'] = priority; + } + if (typeof weight !== 'undefined') { + apiPayload['weight'] = weight; + } + if (typeof port !== 'undefined') { + apiPayload['port'] = port; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * Update an existing SRV record for the given domain. + * + * Required parameters: + * - domainId: Domain unique ID + * - recordId: DNS record unique ID + * - name: Record name (service name) + * - value: Target hostname for this SRV record + * - ttl: Time to live, in seconds + * - priority: Record priority + * - weight: Record weight + * - port: Port number for the service + * + * Optional parameters: + * - comment: A comment for this record + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.recordId - DNS record unique ID. + * @param {string} params.name - Record name (service name). + * @param {string} params.value - Target hostname for this SRV record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {number} params.priority - Record priority. Lower values are tried first. + * @param {number} params.weight - Record weight, used to share load between targets of equal priority. + * @param {number} params.port - Port number for the service. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateRecordSRV(params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + priority: number; + weight: number; + port: number; + comment?: string; + }): Promise; + /** + * Update an existing SRV record for the given domain. + * + * Required parameters: + * - domainId: Domain unique ID + * - recordId: DNS record unique ID + * - name: Record name (service name) + * - value: Target hostname for this SRV record + * - ttl: Time to live, in seconds + * - priority: Record priority + * - weight: Record weight + * - port: Port number for the service + * + * Optional parameters: + * - comment: A comment for this record + * + * @param {string} domainId - Domain unique ID. + * @param {string} recordId - DNS record unique ID. + * @param {string} name - Record name (service name). + * @param {string} value - Target hostname for this SRV record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {number} priority - Record priority. Lower values are tried first. + * @param {number} weight - Record weight, used to share load between targets of equal priority. + * @param {number} port - Port number for the service. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateRecordSRV( + domainId: string, + recordId: string, + name: string, + value: string, + ttl: number, + priority: number, + weight: number, + port: number, + comment?: string, + ): Promise; + updateRecordSRV( + paramsOrFirst: + | { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + priority: number; + weight: number; + port: number; + comment?: string; + } + | string, + ...rest: [ + string?, + string?, + string?, + number?, + number?, + number?, + number?, + string?, + ] + ): Promise { + let params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + priority: number; + weight: number; + port: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + priority: number; + weight: number; + port: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + recordId: rest[0] as string, + name: rest[1] as string, + value: rest[2] as string, + ttl: rest[3] as number, + priority: rest[4] as number, + weight: rest[5] as number, + port: rest[6] as number, + comment: rest[7] as string, + }; + } + + const domainId = params.domainId; + const recordId = params.recordId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const priority = params.priority; + const weight = params.weight; + const port = params.port; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof recordId === 'undefined' || recordId === '') { + throw new AppwriteException( + 'Missing required parameter: "recordId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + if (typeof priority === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "priority"', + ); + } + if (typeof weight === 'undefined') { + throw new AppwriteException('Missing required parameter: "weight"'); + } + if (typeof port === 'undefined') { + throw new AppwriteException('Missing required parameter: "port"'); + } + const apiPath = '/domains/{domainId}/records/srv/{recordId}' + .replace('{domainId}', encodeURIComponent(String(domainId))) + .replace('{recordId}', encodeURIComponent(String(recordId))); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof priority !== 'undefined') { + apiPayload['priority'] = priority; + } + if (typeof weight !== 'undefined') { + apiPayload['weight'] = weight; + } + if (typeof port !== 'undefined') { + apiPayload['port'] = port; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('put', uri, apiHeaders, apiPayload); + } + + /** + * Create a new TXT record for the given domain. TXT records can be used + * to provide additional information about your domain, such as domain + * verification records, SPF records, or DKIM records. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.name - Record name (subdomain) for the TXT record. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} params.value - TXT record value. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + createRecordTXT(params: { + domainId: string; + name: string; + ttl: number; + value?: string; + comment?: string; + }): Promise; + /** + * Create a new TXT record for the given domain. TXT records can be used + * to provide additional information about your domain, such as domain + * verification records, SPF records, or DKIM records. + * + * @param {string} domainId - Domain unique ID. + * @param {string} name - Record name (subdomain) for the TXT record. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} value - TXT record value. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createRecordTXT( + domainId: string, + name: string, + ttl: number, + value?: string, + comment?: string, + ): Promise; + createRecordTXT( + paramsOrFirst: + | { + domainId: string; + name: string; + ttl: number; + value?: string; + comment?: string; + } + | string, + ...rest: [string?, number?, string?, string?] + ): Promise { + let params: { + domainId: string; + name: string; + ttl: number; + value?: string; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + name: string; + ttl: number; + value?: string; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + name: rest[0] as string, + ttl: rest[1] as number, + value: rest[2] as string, + comment: rest[3] as string, + }; + } + + const domainId = params.domainId; + const name = params.name; + const ttl = params.ttl; + const value = params.value; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + const apiPath = '/domains/{domainId}/records/txt'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * Update an existing TXT record for the given domain. + * + * Update the TXT record details for a specific domain by providing the domain ID, + * record ID, and the new record configuration including name, value, TTL, and an optional comment. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.recordId - DNS record unique ID. + * @param {string} params.name - Record name (subdomain) for the TXT record. + * @param {string} params.value - TXT record value. + * @param {number} params.ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} params.comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateRecordTXT(params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }): Promise; + /** + * Update an existing TXT record for the given domain. + * + * Update the TXT record details for a specific domain by providing the domain ID, + * record ID, and the new record configuration including name, value, TTL, and an optional comment. + * + * @param {string} domainId - Domain unique ID. + * @param {string} recordId - DNS record unique ID. + * @param {string} name - Record name (subdomain) for the TXT record. + * @param {string} value - TXT record value. + * @param {number} ttl - Time to live, in seconds. Must be between 1 and 2147483647. + * @param {string} comment - A comment for this record. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateRecordTXT( + domainId: string, + recordId: string, + name: string, + value: string, + ttl: number, + comment?: string, + ): Promise; + updateRecordTXT( + paramsOrFirst: + | { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + } + | string, + ...rest: [string?, string?, string?, number?, string?] + ): Promise { + let params: { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + recordId: string; + name: string; + value: string; + ttl: number; + comment?: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + recordId: rest[0] as string, + name: rest[1] as string, + value: rest[2] as string, + ttl: rest[3] as number, + comment: rest[4] as string, + }; + } + + const domainId = params.domainId; + const recordId = params.recordId; + const name = params.name; + const value = params.value; + const ttl = params.ttl; + const comment = params.comment; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof recordId === 'undefined' || recordId === '') { + throw new AppwriteException( + 'Missing required parameter: "recordId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + if (typeof ttl === 'undefined') { + throw new AppwriteException('Missing required parameter: "ttl"'); + } + const apiPath = '/domains/{domainId}/records/txt/{recordId}' + .replace('{domainId}', encodeURIComponent(String(domainId))) + .replace('{recordId}', encodeURIComponent(String(recordId))); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof value !== 'undefined') { + apiPayload['value'] = value; + } + if (typeof ttl !== 'undefined') { + apiPayload['ttl'] = ttl; + } + if (typeof comment !== 'undefined') { + apiPayload['comment'] = comment; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('put', uri, apiHeaders, apiPayload); + } + + /** + * Get a single DNS record for a given domain by record ID. + * + * This endpoint allows you to retrieve a specific DNS record associated with a domain + * using its unique identifier. The record contains information about the DNS configuration + * such as type, value, and TTL settings. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.recordId - DNS record unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getRecord(params: { + domainId: string; + recordId: string; + }): Promise; + /** + * Get a single DNS record for a given domain by record ID. + * + * This endpoint allows you to retrieve a specific DNS record associated with a domain + * using its unique identifier. The record contains information about the DNS configuration + * such as type, value, and TTL settings. + * + * @param {string} domainId - Domain unique ID. + * @param {string} recordId - DNS record unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getRecord(domainId: string, recordId: string): Promise; + getRecord( + paramsOrFirst: { domainId: string; recordId: string } | string, + ...rest: [string?] + ): Promise { + let params: { domainId: string; recordId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + recordId: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + recordId: rest[0] as string, + }; + } + + const domainId = params.domainId; + const recordId = params.recordId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof recordId === 'undefined' || recordId === '') { + throw new AppwriteException( + 'Missing required parameter: "recordId"', + ); + } + const apiPath = '/domains/{domainId}/records/{recordId}' + .replace('{domainId}', encodeURIComponent(String(domainId))) + .replace('{recordId}', encodeURIComponent(String(recordId))); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }; + + return this.client.call('get', uri, apiHeaders, apiPayload); + } + + /** + * Delete a DNS record for the given domain. This endpoint allows you to delete an existing DNS record + * from a specific domain. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.recordId - DNS record unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteRecord(params: { domainId: string; recordId: string }): Promise<{}>; + /** + * Delete a DNS record for the given domain. This endpoint allows you to delete an existing DNS record + * from a specific domain. + * + * @param {string} domainId - Domain unique ID. + * @param {string} recordId - DNS record unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteRecord(domainId: string, recordId: string): Promise<{}>; + deleteRecord( + paramsOrFirst: { domainId: string; recordId: string } | string, + ...rest: [string?] + ): Promise<{}> { + let params: { domainId: string; recordId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + recordId: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + recordId: rest[0] as string, + }; + } + + const domainId = params.domainId; + const recordId = params.recordId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof recordId === 'undefined' || recordId === '') { + throw new AppwriteException( + 'Missing required parameter: "recordId"', + ); + } + const apiPath = '/domains/{domainId}/records/{recordId}' + .replace('{domainId}', encodeURIComponent(String(domainId))) + .replace('{recordId}', encodeURIComponent(String(recordId))); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('delete', uri, apiHeaders, apiPayload); + } + + /** + * Update the team ID for a specific domain. The caller must administer the current + * team and be an owner of the destination team. + * + * Updating the team ID will transfer ownership and access control of the domain + * and all its DNS records to the new team. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.teamId - New team unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateTeam(params: { + domainId: string; + teamId: string; + }): Promise; + /** + * Update the team ID for a specific domain. The caller must administer the current + * team and be an owner of the destination team. + * + * Updating the team ID will transfer ownership and access control of the domain + * and all its DNS records to the new team. + * + * @param {string} domainId - Domain unique ID. + * @param {string} teamId - New team unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateTeam(domainId: string, teamId: string): Promise; + updateTeam( + paramsOrFirst: { domainId: string; teamId: string } | string, + ...rest: [string?] + ): Promise { + let params: { domainId: string; teamId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + teamId: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + teamId: rest[0] as string, + }; + } + + const domainId = params.domainId; + const teamId = params.teamId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof teamId === 'undefined') { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + const apiPath = '/domains/{domainId}/team'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + if (typeof teamId !== 'undefined') { + apiPayload['teamId'] = teamId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('patch', uri, apiHeaders, apiPayload); + } + + /** + * Retrieve the current transfer status for a domain. Returns the status, an optional reason, and a timestamp of the last status change. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getTransferStatus(params: { + domainId: string; + }): Promise; + /** + * Retrieve the current transfer status for a domain. Returns the status, an optional reason, and a timestamp of the last status change. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getTransferStatus(domainId: string): Promise; + getTransferStatus( + paramsOrFirst: { domainId: string } | string, + ): Promise { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/transfers/status'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }; + + return this.client.call('get', uri, apiHeaders, apiPayload); + } + + /** + * Retrieve the DNS zone file for the given domain. This endpoint will return the DNS + * zone file in a standardized format that can be used to configure DNS servers. + * + * @param {string} params.domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + getZone(params: { domainId: string }): Promise<{}>; + /** + * Retrieve the DNS zone file for the given domain. This endpoint will return the DNS + * zone file in a standardized format that can be used to configure DNS servers. + * + * @param {string} domainId - Domain unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getZone(domainId: string): Promise<{}>; + getZone(paramsOrFirst: { domainId: string } | string): Promise<{}> { + let params: { domainId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { domainId: string }; + } else { + params = { + domainId: paramsOrFirst as string, + }; + } + + const domainId = params.domainId; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + const apiPath = '/domains/{domainId}/zone'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + accept: 'text/plain', + }; + + return this.client.call('get', uri, apiHeaders, apiPayload); + } + + /** + * Update the DNS zone for the given domain using the provided zone file content. + * All parsed records are imported and then the main domain document is returned. + * + * @param {string} params.domainId - Domain unique ID. + * @param {string} params.content - DNS zone file content as a string. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateZone(params: { + domainId: string; + content: string; + }): Promise; + /** + * Update the DNS zone for the given domain using the provided zone file content. + * All parsed records are imported and then the main domain document is returned. + * + * @param {string} domainId - Domain unique ID. + * @param {string} content - DNS zone file content as a string. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateZone(domainId: string, content: string): Promise; + updateZone( + paramsOrFirst: { domainId: string; content: string } | string, + ...rest: [string?] + ): Promise { + let params: { domainId: string; content: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + domainId: string; + content: string; + }; + } else { + params = { + domainId: paramsOrFirst as string, + content: rest[0] as string, + }; + } + + const domainId = params.domainId; + const content = params.content; + if (typeof domainId === 'undefined' || domainId === '') { + throw new AppwriteException( + 'Missing required parameter: "domainId"', + ); + } + if (typeof content === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "content"', + ); + } + const apiPath = '/domains/{domainId}/zone'.replace( + '{domainId}', + encodeURIComponent(String(domainId)), + ); + const apiPayload: Payload = {}; + if (typeof content !== 'undefined') { + apiPayload['content'] = content; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('put', uri, apiHeaders, apiPayload); + } +} diff --git a/src/services/functions.ts b/src/services/functions.ts index 612fd14f..1a50b7af 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -57,7 +57,7 @@ export class Functions { let params: { queries?: string[]; search?: string; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -494,7 +494,7 @@ export class Functions { let params: { type?: string }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -557,7 +557,7 @@ export class Functions { } const functionId = params.functionId; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); @@ -836,7 +836,7 @@ export class Functions { const buildSpecification = params.buildSpecification; const runtimeSpecification = params.runtimeSpecification; const deploymentRetention = params.deploymentRetention; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); @@ -956,7 +956,7 @@ export class Functions { } const functionId = params.functionId; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); @@ -971,6 +971,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -1025,7 +1026,7 @@ export class Functions { const functionId = params.functionId; const deploymentId = params.deploymentId; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); @@ -1129,7 +1130,7 @@ export class Functions { const queries = params.queries; const search = params.search; const total = params.total; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); @@ -1264,7 +1265,7 @@ export class Functions { const activate = params.activate; const entrypoint = params.entrypoint; const commands = params.commands; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); @@ -1373,7 +1374,7 @@ export class Functions { const functionId = params.functionId; const deploymentId = params.deploymentId; const buildId = params.buildId; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); @@ -1518,7 +1519,7 @@ export class Functions { const type = params.type; const reference = params.reference; const activate = params.activate; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); @@ -1657,7 +1658,7 @@ export class Functions { const type = params.type; const reference = params.reference; const activate = params.activate; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); @@ -1744,12 +1745,12 @@ export class Functions { const functionId = params.functionId; const deploymentId = params.deploymentId; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); } - if (typeof deploymentId === 'undefined') { + if (typeof deploymentId === 'undefined' || deploymentId === '') { throw new AppwriteException( 'Missing required parameter: "deploymentId"', ); @@ -1817,12 +1818,12 @@ export class Functions { const functionId = params.functionId; const deploymentId = params.deploymentId; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); } - if (typeof deploymentId === 'undefined') { + if (typeof deploymentId === 'undefined' || deploymentId === '') { throw new AppwriteException( 'Missing required parameter: "deploymentId"', ); @@ -1839,6 +1840,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -1919,12 +1921,12 @@ export class Functions { const deploymentId = params.deploymentId; const type = params.type; const token = params.token; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); } - if (typeof deploymentId === 'undefined') { + if (typeof deploymentId === 'undefined' || deploymentId === '') { throw new AppwriteException( 'Missing required parameter: "deploymentId"', ); @@ -2008,12 +2010,12 @@ export class Functions { const functionId = params.functionId; const deploymentId = params.deploymentId; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); } - if (typeof deploymentId === 'undefined') { + if (typeof deploymentId === 'undefined' || deploymentId === '') { throw new AppwriteException( 'Missing required parameter: "deploymentId"', ); @@ -2095,7 +2097,7 @@ export class Functions { const functionId = params.functionId; const queries = params.queries; const total = params.total; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); @@ -2230,7 +2232,7 @@ export class Functions { const method = params.method; const headers = params.headers; const scheduledAt = params.scheduledAt; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); @@ -2318,12 +2320,12 @@ export class Functions { const functionId = params.functionId; const executionId = params.executionId; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); } - if (typeof executionId === 'undefined') { + if (typeof executionId === 'undefined' || executionId === '') { throw new AppwriteException( 'Missing required parameter: "executionId"', ); @@ -2388,12 +2390,12 @@ export class Functions { const functionId = params.functionId; const executionId = params.executionId; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); } - if (typeof executionId === 'undefined') { + if (typeof executionId === 'undefined' || executionId === '') { throw new AppwriteException( 'Missing required parameter: "executionId"', ); @@ -2407,6 +2409,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -2470,7 +2473,7 @@ export class Functions { const functionId = params.functionId; const queries = params.queries; const total = params.total; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); @@ -2580,7 +2583,7 @@ export class Functions { const key = params.key; const value = params.value; const secret = params.secret; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); @@ -2673,12 +2676,12 @@ export class Functions { const functionId = params.functionId; const variableId = params.variableId; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); } - if (typeof variableId === 'undefined') { + if (typeof variableId === 'undefined' || variableId === '') { throw new AppwriteException( 'Missing required parameter: "variableId"', ); @@ -2781,12 +2784,12 @@ export class Functions { const key = params.key; const value = params.value; const secret = params.secret; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); } - if (typeof variableId === 'undefined') { + if (typeof variableId === 'undefined' || variableId === '') { throw new AppwriteException( 'Missing required parameter: "variableId"', ); @@ -2861,12 +2864,12 @@ export class Functions { const functionId = params.functionId; const variableId = params.variableId; - if (typeof functionId === 'undefined') { + if (typeof functionId === 'undefined' || functionId === '') { throw new AppwriteException( 'Missing required parameter: "functionId"', ); } - if (typeof variableId === 'undefined') { + if (typeof variableId === 'undefined' || variableId === '') { throw new AppwriteException( 'Missing required parameter: "variableId"', ); @@ -2880,6 +2883,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 0f812313..65732ac9 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -47,7 +47,7 @@ export class Messaging { let params: { queries?: string[]; search?: string; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -101,6 +101,8 @@ export class Messaging { * @param {string[]} params.cc - Array of target IDs to be added as CC. * @param {string[]} params.bcc - Array of target IDs to be added as BCC. * @param {string[]} params.attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as :. + * @param {string} params.replyToEmail - Email address to reply to. If not set, defaults to the sender email address. + * @param {string} params.replyToName - Name of the reply to recipient. If not set, defaults to the sender name. * @param {boolean} params.draft - Is message a draft * @param {boolean} params.html - Is content of type HTML * @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. @@ -117,6 +119,8 @@ export class Messaging { cc?: string[]; bcc?: string[]; attachments?: string[]; + replyToEmail?: string; + replyToName?: string; draft?: boolean; html?: boolean; scheduledAt?: string; @@ -133,6 +137,8 @@ export class Messaging { * @param {string[]} cc - Array of target IDs to be added as CC. * @param {string[]} bcc - Array of target IDs to be added as BCC. * @param {string[]} attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as :. + * @param {string} replyToEmail - Email address to reply to. If not set, defaults to the sender email address. + * @param {string} replyToName - Name of the reply to recipient. If not set, defaults to the sender name. * @param {boolean} draft - Is message a draft * @param {boolean} html - Is content of type HTML * @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. @@ -150,6 +156,8 @@ export class Messaging { cc?: string[], bcc?: string[], attachments?: string[], + replyToEmail?: string, + replyToName?: string, draft?: boolean, html?: boolean, scheduledAt?: string, @@ -166,6 +174,8 @@ export class Messaging { cc?: string[]; bcc?: string[]; attachments?: string[]; + replyToEmail?: string; + replyToName?: string; draft?: boolean; html?: boolean; scheduledAt?: string; @@ -180,6 +190,8 @@ export class Messaging { string[]?, string[]?, string[]?, + string?, + string?, boolean?, boolean?, string?, @@ -195,6 +207,8 @@ export class Messaging { cc?: string[]; bcc?: string[]; attachments?: string[]; + replyToEmail?: string; + replyToName?: string; draft?: boolean; html?: boolean; scheduledAt?: string; @@ -215,6 +229,8 @@ export class Messaging { cc?: string[]; bcc?: string[]; attachments?: string[]; + replyToEmail?: string; + replyToName?: string; draft?: boolean; html?: boolean; scheduledAt?: string; @@ -230,9 +246,11 @@ export class Messaging { cc: rest[5] as string[], bcc: rest[6] as string[], attachments: rest[7] as string[], - draft: rest[8] as boolean, - html: rest[9] as boolean, - scheduledAt: rest[10] as string, + replyToEmail: rest[8] as string, + replyToName: rest[9] as string, + draft: rest[10] as boolean, + html: rest[11] as boolean, + scheduledAt: rest[12] as string, }; } @@ -245,6 +263,8 @@ export class Messaging { const cc = params.cc; const bcc = params.bcc; const attachments = params.attachments; + const replyToEmail = params.replyToEmail; + const replyToName = params.replyToName; const draft = params.draft; const html = params.html; const scheduledAt = params.scheduledAt; @@ -292,6 +312,12 @@ export class Messaging { if (typeof attachments !== 'undefined') { apiPayload['attachments'] = attachments; } + if (typeof replyToEmail !== 'undefined') { + apiPayload['replyToEmail'] = replyToEmail; + } + if (typeof replyToName !== 'undefined') { + apiPayload['replyToName'] = replyToName; + } if (typeof draft !== 'undefined') { apiPayload['draft'] = draft; } @@ -326,6 +352,8 @@ export class Messaging { * @param {boolean} params.html - Is content of type HTML * @param {string[]} params.cc - Array of target IDs to be added as CC. * @param {string[]} params.bcc - Array of target IDs to be added as BCC. + * @param {string} params.replyToEmail - Email address to reply to. Pass an empty string to restore the provider or sender default. + * @param {string} params.replyToName - Name of the reply to recipient. Pass an empty string to restore the provider or sender default. * @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. * @param {string[]} params.attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as :. * @throws {AppwriteException} @@ -342,6 +370,8 @@ export class Messaging { html?: boolean; cc?: string[]; bcc?: string[]; + replyToEmail?: string; + replyToName?: string; scheduledAt?: string; attachments?: string[]; }): Promise; @@ -359,6 +389,8 @@ export class Messaging { * @param {boolean} html - Is content of type HTML * @param {string[]} cc - Array of target IDs to be added as CC. * @param {string[]} bcc - Array of target IDs to be added as BCC. + * @param {string} replyToEmail - Email address to reply to. Pass an empty string to restore the provider or sender default. + * @param {string} replyToName - Name of the reply to recipient. Pass an empty string to restore the provider or sender default. * @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. * @param {string[]} attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as :. * @throws {AppwriteException} @@ -376,6 +408,8 @@ export class Messaging { html?: boolean, cc?: string[], bcc?: string[], + replyToEmail?: string, + replyToName?: string, scheduledAt?: string, attachments?: string[], ): Promise; @@ -392,6 +426,8 @@ export class Messaging { html?: boolean; cc?: string[]; bcc?: string[]; + replyToEmail?: string; + replyToName?: string; scheduledAt?: string; attachments?: string[]; } @@ -407,6 +443,8 @@ export class Messaging { string[]?, string[]?, string?, + string?, + string?, string[]?, ] ): Promise { @@ -421,6 +459,8 @@ export class Messaging { html?: boolean; cc?: string[]; bcc?: string[]; + replyToEmail?: string; + replyToName?: string; scheduledAt?: string; attachments?: string[]; }; @@ -441,6 +481,8 @@ export class Messaging { html?: boolean; cc?: string[]; bcc?: string[]; + replyToEmail?: string; + replyToName?: string; scheduledAt?: string; attachments?: string[]; }; @@ -456,8 +498,10 @@ export class Messaging { html: rest[6] as boolean, cc: rest[7] as string[], bcc: rest[8] as string[], - scheduledAt: rest[9] as string, - attachments: rest[10] as string[], + replyToEmail: rest[9] as string, + replyToName: rest[10] as string, + scheduledAt: rest[11] as string, + attachments: rest[12] as string[], }; } @@ -471,9 +515,11 @@ export class Messaging { const html = params.html; const cc = params.cc; const bcc = params.bcc; + const replyToEmail = params.replyToEmail; + const replyToName = params.replyToName; const scheduledAt = params.scheduledAt; const attachments = params.attachments; - if (typeof messageId === 'undefined') { + if (typeof messageId === 'undefined' || messageId === '') { throw new AppwriteException( 'Missing required parameter: "messageId"', ); @@ -510,6 +556,12 @@ export class Messaging { if (typeof bcc !== 'undefined') { apiPayload['bcc'] = bcc; } + if (typeof replyToEmail !== 'undefined') { + apiPayload['replyToEmail'] = replyToEmail; + } + if (typeof replyToName !== 'undefined') { + apiPayload['replyToName'] = replyToName; + } if (typeof scheduledAt !== 'undefined') { apiPayload['scheduledAt'] = scheduledAt; } @@ -1062,7 +1114,7 @@ export class Messaging { const contentAvailable = params.contentAvailable; const critical = params.critical; const priority = params.priority; - if (typeof messageId === 'undefined') { + if (typeof messageId === 'undefined' || messageId === '') { throw new AppwriteException( 'Missing required parameter: "messageId"', ); @@ -1535,7 +1587,7 @@ export class Messaging { const content = params.content; const draft = params.draft; const scheduledAt = params.scheduledAt; - if (typeof messageId === 'undefined') { + if (typeof messageId === 'undefined' || messageId === '') { throw new AppwriteException( 'Missing required parameter: "messageId"', ); @@ -1678,7 +1730,7 @@ export class Messaging { const content = params.content; const draft = params.draft; const scheduledAt = params.scheduledAt; - if (typeof messageId === 'undefined') { + if (typeof messageId === 'undefined' || messageId === '') { throw new AppwriteException( 'Missing required parameter: "messageId"', ); @@ -1754,7 +1806,7 @@ export class Messaging { } const messageId = params.messageId; - if (typeof messageId === 'undefined') { + if (typeof messageId === 'undefined' || messageId === '') { throw new AppwriteException( 'Missing required parameter: "messageId"', ); @@ -1807,7 +1859,7 @@ export class Messaging { } const messageId = params.messageId; - if (typeof messageId === 'undefined') { + if (typeof messageId === 'undefined' || messageId === '') { throw new AppwriteException( 'Missing required parameter: "messageId"', ); @@ -1822,6 +1874,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -1884,7 +1937,7 @@ export class Messaging { const messageId = params.messageId; const queries = params.queries; const total = params.total; - if (typeof messageId === 'undefined') { + if (typeof messageId === 'undefined' || messageId === '') { throw new AppwriteException( 'Missing required parameter: "messageId"', ); @@ -1947,7 +2000,7 @@ export class Messaging { let params: { queries?: string[]; search?: string; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -2438,7 +2491,7 @@ export class Messaging { const teamId = params.teamId; const bundleId = params.bundleId; const sandbox = params.sandbox; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -2599,7 +2652,7 @@ export class Messaging { const teamId = params.teamId; const bundleId = params.bundleId; const sandbox = params.sandbox; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -2641,6 +2694,243 @@ export class Messaging { return this.client.call('patch', uri, apiHeaders, apiPayload); } + /** + * Create a new Appwrite push provider. + * + * @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Provider name. + * @param {boolean} params.enabled - Set as enabled. + * @param {number} params.qos - Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose. + * @param {number} params.expiry - Default message retention in seconds for offline delivery. Max 7 days (604800). + * @throws {AppwriteException} + * @returns {Promise} + */ + createAppwriteProvider(params: { + providerId: string; + name: string; + enabled?: boolean; + qos?: number; + expiry?: number; + }): Promise; + /** + * Create a new Appwrite push provider. + * + * @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Provider name. + * @param {boolean} enabled - Set as enabled. + * @param {number} qos - Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose. + * @param {number} expiry - Default message retention in seconds for offline delivery. Max 7 days (604800). + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createAppwriteProvider( + providerId: string, + name: string, + enabled?: boolean, + qos?: number, + expiry?: number, + ): Promise; + createAppwriteProvider( + paramsOrFirst: + | { + providerId: string; + name: string; + enabled?: boolean; + qos?: number; + expiry?: number; + } + | string, + ...rest: [string?, boolean?, number?, number?] + ): Promise { + let params: { + providerId: string; + name: string; + enabled?: boolean; + qos?: number; + expiry?: number; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + providerId: string; + name: string; + enabled?: boolean; + qos?: number; + expiry?: number; + }; + } else { + params = { + providerId: paramsOrFirst as string, + name: rest[0] as string, + enabled: rest[1] as boolean, + qos: rest[2] as number, + expiry: rest[3] as number, + }; + } + + const providerId = params.providerId; + const name = params.name; + const enabled = params.enabled; + const qos = params.qos; + const expiry = params.expiry; + if (typeof providerId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "providerId"', + ); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + const apiPath = '/messaging/providers/appwrite'; + const apiPayload: Payload = {}; + if (typeof providerId !== 'undefined') { + apiPayload['providerId'] = providerId; + } + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof enabled !== 'undefined') { + apiPayload['enabled'] = enabled; + } + if (typeof qos !== 'undefined') { + apiPayload['qos'] = qos; + } + if (typeof expiry !== 'undefined') { + apiPayload['expiry'] = expiry; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + + /** + * Update an Appwrite push provider by its unique ID. + * + * @param {string} params.providerId - Provider ID. + * @param {string} params.name - Provider name. + * @param {boolean} params.enabled - Set as enabled. + * @param {number} params.qos - Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose. + * @param {number} params.expiry - Default message retention in seconds for offline delivery. Max 7 days (604800). + * @throws {AppwriteException} + * @returns {Promise} + */ + updateAppwriteProvider(params: { + providerId: string; + name?: string; + enabled?: boolean; + qos?: number; + expiry?: number; + }): Promise; + /** + * Update an Appwrite push provider by its unique ID. + * + * @param {string} providerId - Provider ID. + * @param {string} name - Provider name. + * @param {boolean} enabled - Set as enabled. + * @param {number} qos - Default QoS for topics on this provider (0 or 1). Null lets the subscriber choose. + * @param {number} expiry - Default message retention in seconds for offline delivery. Max 7 days (604800). + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateAppwriteProvider( + providerId: string, + name?: string, + enabled?: boolean, + qos?: number, + expiry?: number, + ): Promise; + updateAppwriteProvider( + paramsOrFirst: + | { + providerId: string; + name?: string; + enabled?: boolean; + qos?: number; + expiry?: number; + } + | string, + ...rest: [string?, boolean?, number?, number?] + ): Promise { + let params: { + providerId: string; + name?: string; + enabled?: boolean; + qos?: number; + expiry?: number; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + providerId: string; + name?: string; + enabled?: boolean; + qos?: number; + expiry?: number; + }; + } else { + params = { + providerId: paramsOrFirst as string, + name: rest[0] as string, + enabled: rest[1] as boolean, + qos: rest[2] as number, + expiry: rest[3] as number, + }; + } + + const providerId = params.providerId; + const name = params.name; + const enabled = params.enabled; + const qos = params.qos; + const expiry = params.expiry; + if (typeof providerId === 'undefined' || providerId === '') { + throw new AppwriteException( + 'Missing required parameter: "providerId"', + ); + } + const apiPath = '/messaging/providers/appwrite/{providerId}'.replace( + '{providerId}', + encodeURIComponent(String(providerId)), + ); + const apiPayload: Payload = {}; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; + } + if (typeof enabled !== 'undefined') { + apiPayload['enabled'] = enabled; + } + if (typeof qos !== 'undefined') { + apiPayload['qos'] = qos; + } + if (typeof expiry !== 'undefined') { + apiPayload['expiry'] = expiry; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('patch', uri, apiHeaders, apiPayload); + } + /** * Create a new Firebase Cloud Messaging provider. * @@ -2934,7 +3224,7 @@ export class Messaging { const name = params.name; const enabled = params.enabled; const serviceAccountJSON = params.serviceAccountJSON; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -3039,7 +3329,7 @@ export class Messaging { const name = params.name; const enabled = params.enabled; const serviceAccountJSON = params.serviceAccountJSON; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -3398,7 +3688,7 @@ export class Messaging { const fromEmail = params.fromEmail; const replyToName = params.replyToName; const replyToEmail = params.replyToEmail; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -3671,7 +3961,7 @@ export class Messaging { const templateId = params.templateId; const senderId = params.senderId; const authKey = params.authKey; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -3990,7 +4280,7 @@ export class Messaging { const fromEmail = params.fromEmail; const replyToName = params.replyToName; const replyToEmail = params.replyToEmail; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -4315,7 +4605,7 @@ export class Messaging { const fromEmail = params.fromEmail; const replyToName = params.replyToName; const replyToEmail = params.replyToEmail; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -4686,7 +4976,7 @@ export class Messaging { const fromEmail = params.fromEmail; const replyToName = params.replyToName; const replyToEmail = params.replyToEmail; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -5405,7 +5695,7 @@ export class Messaging { const replyToName = params.replyToName; const replyToEmail = params.replyToEmail; const enabled = params.enabled; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -5644,7 +5934,7 @@ export class Messaging { const replyToName = params.replyToName; const replyToEmail = params.replyToEmail; const enabled = params.enabled; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -5929,7 +6219,7 @@ export class Messaging { const customerId = params.customerId; const apiKey = params.apiKey; const from = params.from; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -6190,7 +6480,7 @@ export class Messaging { const username = params.username; const apiKey = params.apiKey; const from = params.from; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -6231,7 +6521,7 @@ export class Messaging { * * @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} params.name - Provider name. - * @param {string} params.from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. + * @param {string} params.from - Sender phone number or alphanumeric sender ID. Format phone numbers with a leading '+' and a country code, e.g., +16175551212. * @param {string} params.accountSid - Twilio account secret ID. * @param {string} params.authToken - Twilio authentication token. * @param {boolean} params.enabled - Set as enabled. @@ -6251,7 +6541,7 @@ export class Messaging { * * @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} name - Provider name. - * @param {string} from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. + * @param {string} from - Sender phone number or alphanumeric sender ID. Format phone numbers with a leading '+' and a country code, e.g., +16175551212. * @param {string} accountSid - Twilio account secret ID. * @param {string} authToken - Twilio authentication token. * @param {boolean} enabled - Set as enabled. @@ -6366,7 +6656,7 @@ export class Messaging { * @param {boolean} params.enabled - Set as enabled. * @param {string} params.accountSid - Twilio account secret ID. * @param {string} params.authToken - Twilio authentication token. - * @param {string} params.from - Sender number. + * @param {string} params.from - Sender phone number or alphanumeric sender ID. Format phone numbers with a leading '+' and a country code, e.g., +16175551212. * @throws {AppwriteException} * @returns {Promise} */ @@ -6386,7 +6676,7 @@ export class Messaging { * @param {boolean} enabled - Set as enabled. * @param {string} accountSid - Twilio account secret ID. * @param {string} authToken - Twilio authentication token. - * @param {string} from - Sender number. + * @param {string} from - Sender phone number or alphanumeric sender ID. Format phone numbers with a leading '+' and a country code, e.g., +16175551212. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -6451,7 +6741,7 @@ export class Messaging { const accountSid = params.accountSid; const authToken = params.authToken; const from = params.from; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -6712,7 +7002,7 @@ export class Messaging { const apiKey = params.apiKey; const apiSecret = params.apiSecret; const from = params.from; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -6785,7 +7075,7 @@ export class Messaging { } const providerId = params.providerId; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -6840,7 +7130,7 @@ export class Messaging { } const providerId = params.providerId; - if (typeof providerId === 'undefined') { + if (typeof providerId === 'undefined' || providerId === '') { throw new AppwriteException( 'Missing required parameter: "providerId"', ); @@ -6855,6 +7145,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -6897,7 +7188,7 @@ export class Messaging { let params: { queries?: string[]; search?: string; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -6945,6 +7236,8 @@ export class Messaging { * @param {string} params.topicId - Topic ID. Choose a custom Topic ID or a new Topic ID. * @param {string} params.name - Topic Name. * @param {string[]} params.subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. + * @param {number} params.qos - MQTT delivery quality of service for this topic. 0 is fire-and-forget (delivered only to clients connected at publish time). 1 persists each message and replays it when a client reconnects without having acknowledged it. Null lets the subscriber choose. + * @param {number} params.expiry - Message retention in seconds for offline delivery. Max 7 days (604800). * @throws {AppwriteException} * @returns {Promise} */ @@ -6952,6 +7245,8 @@ export class Messaging { topicId: string; name: string; subscribe?: string[]; + qos?: number; + expiry?: number; }): Promise; /** * Create a new topic. @@ -6959,6 +7254,8 @@ export class Messaging { * @param {string} topicId - Topic ID. Choose a custom Topic ID or a new Topic ID. * @param {string} name - Topic Name. * @param {string[]} subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. + * @param {number} qos - MQTT delivery quality of service for this topic. 0 is fire-and-forget (delivered only to clients connected at publish time). 1 persists each message and replays it when a client reconnects without having acknowledged it. Null lets the subscriber choose. + * @param {number} expiry - Message retention in seconds for offline delivery. Max 7 days (604800). * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -6967,13 +7264,28 @@ export class Messaging { topicId: string, name: string, subscribe?: string[], + qos?: number, + expiry?: number, ): Promise; createTopic( paramsOrFirst: - { topicId: string; name: string; subscribe?: string[] } | string, - ...rest: [string?, string[]?] + | { + topicId: string; + name: string; + subscribe?: string[]; + qos?: number; + expiry?: number; + } + | string, + ...rest: [string?, string[]?, number?, number?] ): Promise { - let params: { topicId: string; name: string; subscribe?: string[] }; + let params: { + topicId: string; + name: string; + subscribe?: string[]; + qos?: number; + expiry?: number; + }; if ( paramsOrFirst && @@ -6984,18 +7296,24 @@ export class Messaging { topicId: string; name: string; subscribe?: string[]; + qos?: number; + expiry?: number; }; } else { params = { topicId: paramsOrFirst as string, name: rest[0] as string, subscribe: rest[1] as string[], + qos: rest[2] as number, + expiry: rest[3] as number, }; } const topicId = params.topicId; const name = params.name; const subscribe = params.subscribe; + const qos = params.qos; + const expiry = params.expiry; if (typeof topicId === 'undefined') { throw new AppwriteException( 'Missing required parameter: "topicId"', @@ -7015,6 +7333,12 @@ export class Messaging { if (typeof subscribe !== 'undefined') { apiPayload['subscribe'] = subscribe; } + if (typeof qos !== 'undefined') { + apiPayload['qos'] = qos; + } + if (typeof expiry !== 'undefined') { + apiPayload['expiry'] = expiry; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -7063,7 +7387,7 @@ export class Messaging { } const topicId = params.topicId; - if (typeof topicId === 'undefined') { + if (typeof topicId === 'undefined' || topicId === '') { throw new AppwriteException( 'Missing required parameter: "topicId"', ); @@ -7090,6 +7414,8 @@ export class Messaging { * @param {string} params.topicId - Topic ID. * @param {string} params.name - Topic Name. * @param {string[]} params.subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. + * @param {number} params.qos - MQTT delivery quality of service for this topic. 0 is fire-and-forget (delivered only to clients connected at publish time). 1 persists each message and replays it when a client reconnects without having acknowledged it. Null lets the subscriber choose. + * @param {number} params.expiry - Message retention in seconds for offline delivery. Max 7 days (604800). * @throws {AppwriteException} * @returns {Promise} */ @@ -7097,6 +7423,8 @@ export class Messaging { topicId: string; name?: string; subscribe?: string[]; + qos?: number; + expiry?: number; }): Promise; /** * Update a topic by its unique ID. @@ -7105,6 +7433,8 @@ export class Messaging { * @param {string} topicId - Topic ID. * @param {string} name - Topic Name. * @param {string[]} subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. + * @param {number} qos - MQTT delivery quality of service for this topic. 0 is fire-and-forget (delivered only to clients connected at publish time). 1 persists each message and replays it when a client reconnects without having acknowledged it. Null lets the subscriber choose. + * @param {number} expiry - Message retention in seconds for offline delivery. Max 7 days (604800). * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -7113,13 +7443,28 @@ export class Messaging { topicId: string, name?: string, subscribe?: string[], + qos?: number, + expiry?: number, ): Promise; updateTopic( paramsOrFirst: - { topicId: string; name?: string; subscribe?: string[] } | string, - ...rest: [string?, string[]?] + | { + topicId: string; + name?: string; + subscribe?: string[]; + qos?: number; + expiry?: number; + } + | string, + ...rest: [string?, string[]?, number?, number?] ): Promise { - let params: { topicId: string; name?: string; subscribe?: string[] }; + let params: { + topicId: string; + name?: string; + subscribe?: string[]; + qos?: number; + expiry?: number; + }; if ( paramsOrFirst && @@ -7130,19 +7475,25 @@ export class Messaging { topicId: string; name?: string; subscribe?: string[]; + qos?: number; + expiry?: number; }; } else { params = { topicId: paramsOrFirst as string, name: rest[0] as string, subscribe: rest[1] as string[], + qos: rest[2] as number, + expiry: rest[3] as number, }; } const topicId = params.topicId; const name = params.name; const subscribe = params.subscribe; - if (typeof topicId === 'undefined') { + const qos = params.qos; + const expiry = params.expiry; + if (typeof topicId === 'undefined' || topicId === '') { throw new AppwriteException( 'Missing required parameter: "topicId"', ); @@ -7158,6 +7509,12 @@ export class Messaging { if (typeof subscribe !== 'undefined') { apiPayload['subscribe'] = subscribe; } + if (typeof qos !== 'undefined') { + apiPayload['qos'] = qos; + } + if (typeof expiry !== 'undefined') { + apiPayload['expiry'] = expiry; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -7202,7 +7559,7 @@ export class Messaging { } const topicId = params.topicId; - if (typeof topicId === 'undefined') { + if (typeof topicId === 'undefined' || topicId === '') { throw new AppwriteException( 'Missing required parameter: "topicId"', ); @@ -7217,6 +7574,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -7297,7 +7655,7 @@ export class Messaging { const queries = params.queries; const search = params.search; const total = params.total; - if (typeof topicId === 'undefined') { + if (typeof topicId === 'undefined' || topicId === '') { throw new AppwriteException( 'Missing required parameter: "topicId"', ); @@ -7384,7 +7742,7 @@ export class Messaging { const topicId = params.topicId; const subscriberId = params.subscriberId; const targetId = params.targetId; - if (typeof topicId === 'undefined') { + if (typeof topicId === 'undefined' || topicId === '') { throw new AppwriteException( 'Missing required parameter: "topicId"', ); @@ -7472,12 +7830,12 @@ export class Messaging { const topicId = params.topicId; const subscriberId = params.subscriberId; - if (typeof topicId === 'undefined') { + if (typeof topicId === 'undefined' || topicId === '') { throw new AppwriteException( 'Missing required parameter: "topicId"', ); } - if (typeof subscriberId === 'undefined') { + if (typeof subscriberId === 'undefined' || subscriberId === '') { throw new AppwriteException( 'Missing required parameter: "subscriberId"', ); @@ -7545,12 +7903,12 @@ export class Messaging { const topicId = params.topicId; const subscriberId = params.subscriberId; - if (typeof topicId === 'undefined') { + if (typeof topicId === 'undefined' || topicId === '') { throw new AppwriteException( 'Missing required parameter: "topicId"', ); } - if (typeof subscriberId === 'undefined') { + if (typeof subscriberId === 'undefined' || subscriberId === '') { throw new AppwriteException( 'Missing required parameter: "subscriberId"', ); @@ -7567,6 +7925,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); diff --git a/src/services/mongo.ts b/src/services/mongo.ts index c6492168..e4ce1d9e 100644 --- a/src/services/mongo.ts +++ b/src/services/mongo.ts @@ -33,7 +33,7 @@ export class Mongo { let params: { queries?: string[] }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -77,7 +77,7 @@ export class Mongo { * @param {number} params.pitrRetentionDays - Number of days to retain PITR data. * @param {boolean} params.storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. * @param {number} params.storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. + * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. * @throws {AppwriteException} * @returns {Promise} */ @@ -113,7 +113,7 @@ export class Mongo { * @param {number} pitrRetentionDays - Number of days to retain PITR data. * @param {boolean} storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. * @param {number} storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. + * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -306,7 +306,7 @@ export class Mongo { } /** - * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, pricing, and whether it is enabled for the organization. + * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, its own prices and overage rates, and whether it is enabled for the organization. * * @throws {AppwriteException} * @returns {Promise} @@ -359,7 +359,7 @@ export class Mongo { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -630,7 +630,7 @@ export class Mongo { const sqlApiMaxRows = params.sqlApiMaxRows; const sqlApiMaxBytes = params.sqlApiMaxBytes; const sqlApiTimeoutSeconds = params.sqlApiTimeoutSeconds; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -746,7 +746,7 @@ export class Mongo { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -816,7 +816,7 @@ export class Mongo { const databaseId = params.databaseId; const queries = params.queries; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -888,7 +888,7 @@ export class Mongo { const databaseId = params.databaseId; const type = params.type; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -961,7 +961,7 @@ export class Mongo { const databaseId = params.databaseId; const queries = params.queries; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1086,7 +1086,7 @@ export class Mongo { const retention = params.retention; const type = params.type; const enabled = params.enabled; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1192,12 +1192,12 @@ export class Mongo { const databaseId = params.databaseId; const policyId = params.policyId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof policyId === 'undefined') { + if (typeof policyId === 'undefined' || policyId === '') { throw new AppwriteException( 'Missing required parameter: "policyId"', ); @@ -1309,12 +1309,12 @@ export class Mongo { const schedule = params.schedule; const retention = params.retention; const enabled = params.enabled; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof policyId === 'undefined') { + if (typeof policyId === 'undefined' || policyId === '') { throw new AppwriteException( 'Missing required parameter: "policyId"', ); @@ -1392,12 +1392,12 @@ export class Mongo { const databaseId = params.databaseId; const policyId = params.policyId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof policyId === 'undefined') { + if (typeof policyId === 'undefined' || policyId === '') { throw new AppwriteException( 'Missing required parameter: "policyId"', ); @@ -1528,7 +1528,7 @@ export class Mongo { const region = params.region; const prefix = params.prefix; const endpoint = params.endpoint; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1637,12 +1637,12 @@ export class Mongo { const databaseId = params.databaseId; const backupId = params.backupId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof backupId === 'undefined') { + if (typeof backupId === 'undefined' || backupId === '') { throw new AppwriteException( 'Missing required parameter: "backupId"', ); @@ -1704,12 +1704,12 @@ export class Mongo { const databaseId = params.databaseId; const backupId = params.backupId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof backupId === 'undefined') { + if (typeof backupId === 'undefined' || backupId === '') { throw new AppwriteException( 'Missing required parameter: "backupId"', ); @@ -1768,7 +1768,7 @@ export class Mongo { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1845,7 +1845,7 @@ export class Mongo { const databaseId = params.databaseId; const branchId = params.branchId; const ttl = params.ttl; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1921,12 +1921,12 @@ export class Mongo { const databaseId = params.databaseId; const branchId = params.branchId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof branchId === 'undefined') { + if (typeof branchId === 'undefined' || branchId === '') { throw new AppwriteException( 'Missing required parameter: "branchId"', ); @@ -1985,7 +1985,7 @@ export class Mongo { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2056,7 +2056,7 @@ export class Mongo { const databaseId = params.databaseId; const targetReplicaId = params.targetReplicaId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2137,7 +2137,7 @@ export class Mongo { const databaseId = params.databaseId; const day = params.day; const hourUtc = params.hourUtc; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2234,7 +2234,7 @@ export class Mongo { const databaseId = params.databaseId; const targetType = params.targetType; const specification = params.specification; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2341,7 +2341,7 @@ export class Mongo { const status = params.status; const limit = params.limit; const offset = params.offset; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2407,7 +2407,7 @@ export class Mongo { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2464,7 +2464,7 @@ export class Mongo { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2568,7 +2568,7 @@ export class Mongo { const type = params.type; const limit = params.limit; const offset = params.offset; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2684,7 +2684,7 @@ export class Mongo { const backupId = params.backupId; const targetDatabaseId = params.targetDatabaseId; const targetTime = params.targetTime; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2766,12 +2766,12 @@ export class Mongo { const databaseId = params.databaseId; const restorationId = params.restorationId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof restorationId === 'undefined') { + if (typeof restorationId === 'undefined' || restorationId === '') { throw new AppwriteException( 'Missing required parameter: "restorationId"', ); @@ -2828,7 +2828,7 @@ export class Mongo { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2897,7 +2897,7 @@ export class Mongo { const databaseId = params.databaseId; const targetVersion = params.targetVersion; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); diff --git a/src/services/mysql.ts b/src/services/mysql.ts index 61fc35d4..701198fd 100644 --- a/src/services/mysql.ts +++ b/src/services/mysql.ts @@ -33,7 +33,7 @@ export class Mysql { let params: { queries?: string[] }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -77,7 +77,7 @@ export class Mysql { * @param {number} params.pitrRetentionDays - Number of days to retain PITR data. * @param {boolean} params.storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. * @param {number} params.storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. + * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. * @throws {AppwriteException} * @returns {Promise} */ @@ -113,7 +113,7 @@ export class Mysql { * @param {number} pitrRetentionDays - Number of days to retain PITR data. * @param {boolean} storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. * @param {number} storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. + * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -306,7 +306,7 @@ export class Mysql { } /** - * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, pricing, and whether it is enabled for the organization. + * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, its own prices and overage rates, and whether it is enabled for the organization. * * @throws {AppwriteException} * @returns {Promise} @@ -359,7 +359,7 @@ export class Mysql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -630,7 +630,7 @@ export class Mysql { const sqlApiMaxRows = params.sqlApiMaxRows; const sqlApiMaxBytes = params.sqlApiMaxBytes; const sqlApiTimeoutSeconds = params.sqlApiTimeoutSeconds; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -746,7 +746,7 @@ export class Mysql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -816,7 +816,7 @@ export class Mysql { const databaseId = params.databaseId; const queries = params.queries; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -888,7 +888,7 @@ export class Mysql { const databaseId = params.databaseId; const type = params.type; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -961,7 +961,7 @@ export class Mysql { const databaseId = params.databaseId; const queries = params.queries; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1086,7 +1086,7 @@ export class Mysql { const retention = params.retention; const type = params.type; const enabled = params.enabled; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1192,12 +1192,12 @@ export class Mysql { const databaseId = params.databaseId; const policyId = params.policyId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof policyId === 'undefined') { + if (typeof policyId === 'undefined' || policyId === '') { throw new AppwriteException( 'Missing required parameter: "policyId"', ); @@ -1309,12 +1309,12 @@ export class Mysql { const schedule = params.schedule; const retention = params.retention; const enabled = params.enabled; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof policyId === 'undefined') { + if (typeof policyId === 'undefined' || policyId === '') { throw new AppwriteException( 'Missing required parameter: "policyId"', ); @@ -1392,12 +1392,12 @@ export class Mysql { const databaseId = params.databaseId; const policyId = params.policyId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof policyId === 'undefined') { + if (typeof policyId === 'undefined' || policyId === '') { throw new AppwriteException( 'Missing required parameter: "policyId"', ); @@ -1528,7 +1528,7 @@ export class Mysql { const region = params.region; const prefix = params.prefix; const endpoint = params.endpoint; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1637,12 +1637,12 @@ export class Mysql { const databaseId = params.databaseId; const backupId = params.backupId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof backupId === 'undefined') { + if (typeof backupId === 'undefined' || backupId === '') { throw new AppwriteException( 'Missing required parameter: "backupId"', ); @@ -1704,12 +1704,12 @@ export class Mysql { const databaseId = params.databaseId; const backupId = params.backupId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof backupId === 'undefined') { + if (typeof backupId === 'undefined' || backupId === '') { throw new AppwriteException( 'Missing required parameter: "backupId"', ); @@ -1768,7 +1768,7 @@ export class Mysql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1845,7 +1845,7 @@ export class Mysql { const databaseId = params.databaseId; const branchId = params.branchId; const ttl = params.ttl; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1921,12 +1921,12 @@ export class Mysql { const databaseId = params.databaseId; const branchId = params.branchId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof branchId === 'undefined') { + if (typeof branchId === 'undefined' || branchId === '') { throw new AppwriteException( 'Missing required parameter: "branchId"', ); @@ -1985,7 +1985,7 @@ export class Mysql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2081,7 +2081,7 @@ export class Mysql { const sql = params.sql; const bindings = params.bindings; const timeoutSeconds = params.timeoutSeconds; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2164,7 +2164,7 @@ export class Mysql { const databaseId = params.databaseId; const targetReplicaId = params.targetReplicaId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2245,7 +2245,7 @@ export class Mysql { const databaseId = params.databaseId; const day = params.day; const hourUtc = params.hourUtc; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2342,7 +2342,7 @@ export class Mysql { const databaseId = params.databaseId; const targetType = params.targetType; const specification = params.specification; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2449,7 +2449,7 @@ export class Mysql { const status = params.status; const limit = params.limit; const offset = params.offset; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2515,7 +2515,7 @@ export class Mysql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2572,7 +2572,7 @@ export class Mysql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2721,7 +2721,7 @@ export class Mysql { const poolerCpuLimit = params.poolerCpuLimit; const poolerMemoryRequest = params.poolerMemoryRequest; const poolerMemoryLimit = params.poolerMemoryLimit; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2803,7 +2803,7 @@ export class Mysql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2907,7 +2907,7 @@ export class Mysql { const type = params.type; const limit = params.limit; const offset = params.offset; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -3023,7 +3023,7 @@ export class Mysql { const backupId = params.backupId; const targetDatabaseId = params.targetDatabaseId; const targetTime = params.targetTime; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -3105,12 +3105,12 @@ export class Mysql { const databaseId = params.databaseId; const restorationId = params.restorationId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof restorationId === 'undefined') { + if (typeof restorationId === 'undefined' || restorationId === '') { throw new AppwriteException( 'Missing required parameter: "restorationId"', ); @@ -3167,7 +3167,7 @@ export class Mysql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -3236,7 +3236,7 @@ export class Mysql { const databaseId = params.databaseId; const targetVersion = params.targetVersion; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); diff --git a/src/services/oauth-2.ts b/src/services/oauth-2.ts index b05acbdb..31f94b9a 100644 --- a/src/services/oauth-2.ts +++ b/src/services/oauth-2.ts @@ -225,7 +225,7 @@ export class Oauth2 { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -461,7 +461,7 @@ export class Oauth2 { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -630,7 +630,7 @@ export class Oauth2 { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -780,7 +780,7 @@ export class Oauth2 { } const grantId = params.grantId; - if (typeof grantId === 'undefined') { + if (typeof grantId === 'undefined' || grantId === '') { throw new AppwriteException( 'Missing required parameter: "grantId"', ); @@ -801,6 +801,111 @@ export class Oauth2 { return this.client.call('get', uri, apiHeaders, apiPayload); } + /** + * Introspect an OAuth2 access token or refresh token. Authenticate with an API key holding the `oauth2.introspect` scope to introspect any token in the project, or with the client credentials of the app the token was issued to. + * + * @param {string} params.token - The access token or refresh token to introspect. + * @param {string} params.tokenTypeHint - Type of token to introspect. Can be one of: `access_token` or `refresh_token`. + * @param {string} params.clientId - OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. + * @param {string} params.clientSecret - OAuth2 client secret. + * @throws {AppwriteException} + * @returns {Promise} + */ + introspect(params: { + token: string; + tokenTypeHint?: string; + clientId?: string; + clientSecret?: string; + }): Promise; + /** + * Introspect an OAuth2 access token or refresh token. Authenticate with an API key holding the `oauth2.introspect` scope to introspect any token in the project, or with the client credentials of the app the token was issued to. + * + * @param {string} token - The access token or refresh token to introspect. + * @param {string} tokenTypeHint - Type of token to introspect. Can be one of: `access_token` or `refresh_token`. + * @param {string} clientId - OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. + * @param {string} clientSecret - OAuth2 client secret. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + introspect( + token: string, + tokenTypeHint?: string, + clientId?: string, + clientSecret?: string, + ): Promise; + introspect( + paramsOrFirst: + | { + token: string; + tokenTypeHint?: string; + clientId?: string; + clientSecret?: string; + } + | string, + ...rest: [string?, string?, string?] + ): Promise { + let params: { + token: string; + tokenTypeHint?: string; + clientId?: string; + clientSecret?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + token: string; + tokenTypeHint?: string; + clientId?: string; + clientSecret?: string; + }; + } else { + params = { + token: paramsOrFirst as string, + tokenTypeHint: rest[0] as string, + clientId: rest[1] as string, + clientSecret: rest[2] as string, + }; + } + + const token = params.token; + const tokenTypeHint = params.tokenTypeHint; + const clientId = params.clientId; + const clientSecret = params.clientSecret; + if (typeof token === 'undefined') { + throw new AppwriteException('Missing required parameter: "token"'); + } + const apiPath = '/oauth2/{project_id}/introspect'.replace( + '{project_id}', + encodeURIComponent(String(this.client.config.project)), + ); + const apiPayload: Payload = {}; + if (typeof token !== 'undefined') { + apiPayload['token'] = token; + } + if (typeof tokenTypeHint !== 'undefined') { + apiPayload['token_type_hint'] = tokenTypeHint; + } + if (typeof clientId !== 'undefined') { + apiPayload['client_id'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + apiPayload['client_secret'] = clientSecret; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('post', uri, apiHeaders, apiPayload); + } + /** * List the organizations the OAuth2 access token can access. Resolves the token's `organization` authorization details, expanding the `*` wildcard into the concrete set of organizations the user can see. * @@ -838,7 +943,7 @@ export class Oauth2 { let params: { limit?: number; offset?: number; search?: string }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -1157,7 +1262,7 @@ export class Oauth2 { let params: { limit?: number; offset?: number; search?: string }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) diff --git a/src/services/organization.ts b/src/services/organization.ts index a79629b9..955a6968 100644 --- a/src/services/organization.ts +++ b/src/services/organization.ts @@ -1,8 +1,8 @@ import { AppwriteException, Client, type Payload } from '../client'; import type { Models } from '../models'; -import { OrganizationKeyScopes } from '../enums/organization-key-scopes'; import { Region } from '../enums/region'; +import { ProjectKeyScopes } from '../enums/project-key-scopes'; export class Organization { client: Client; @@ -103,6 +103,7 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -140,7 +141,7 @@ export class Organization { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -285,7 +286,7 @@ export class Organization { } const installationId = params.installationId; - if (typeof installationId === 'undefined') { + if (typeof installationId === 'undefined' || installationId === '') { throw new AppwriteException( 'Missing required parameter: "installationId"', ); @@ -355,7 +356,7 @@ export class Organization { const installationId = params.installationId; const authorizationDetails = params.authorizationDetails; - if (typeof installationId === 'undefined') { + if (typeof installationId === 'undefined' || installationId === '') { throw new AppwriteException( 'Missing required parameter: "installationId"', ); @@ -414,7 +415,7 @@ export class Organization { } const installationId = params.installationId; - if (typeof installationId === 'undefined') { + if (typeof installationId === 'undefined' || installationId === '') { throw new AppwriteException( 'Missing required parameter: "installationId"', ); @@ -436,57 +437,71 @@ export class Organization { } /** - * Get a list of all API keys from the current organization. + * Get a list of all memberships from the current organization. * - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles + * @param {string} params.search - Search term to filter your list results. Max length: 256 chars. * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - listKeys(params?: { + listMemberships(params?: { queries?: string[]; + search?: string; total?: boolean; - }): Promise; + }): Promise; /** - * Get a list of all API keys from the current organization. + * Get a list of all memberships from the current organization. * - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles + * @param {string} search - Search term to filter your list results. Max length: 256 chars. * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - listKeys(queries?: string[], total?: boolean): Promise; - listKeys( - paramsOrFirst?: { queries?: string[]; total?: boolean } | string[], - ...rest: [boolean?] - ): Promise { - let params: { queries?: string[]; total?: boolean }; + listMemberships( + queries?: string[], + search?: string, + total?: boolean, + ): Promise; + listMemberships( + paramsOrFirst?: + { queries?: string[]; search?: string; total?: boolean } | string[], + ...rest: [string?, boolean?] + ): Promise { + let params: { queries?: string[]; search?: string; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) ) { params = (paramsOrFirst || {}) as { queries?: string[]; + search?: string; total?: boolean; }; } else { params = { queries: paramsOrFirst as string[], - total: rest[0] as boolean, + search: rest[0] as string, + total: rest[1] as boolean, }; } const queries = params.queries; + const search = params.search; const total = params.total; - const apiPath = '/organization/keys'; + const apiPath = '/organization/memberships'; const apiPayload: Payload = {}; if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } + if (typeof search !== 'undefined') { + apiPayload['search'] = search; + } if (typeof total !== 'undefined') { apiPayload['total'] = total; } @@ -501,54 +516,66 @@ export class Organization { } /** - * Create a new organization API key. + * Invite a new member to join the current organization. An email with a link to join the organization will be sent to the new member's email address. If member doesn't exist in the project it will be automatically created. * - * @param {string} params.keyId - Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} params.name - Key name. Max length: 128 chars. - * @param {OrganizationKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string[]} params.roles - Array of strings. Use this param to set the user roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. + * @param {string} params.email - Email of the new organization member. + * @param {string} params.userId - ID of the user to be added to the organization. + * @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. + * @param {string} params.url - URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. + * @param {string} params.name - Name of the new organization member. Max length: 128 chars. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - createKey(params: { - keyId: string; - name: string; - scopes: OrganizationKeyScopes[]; - expire?: string; - }): Promise; + createMembership(params: { + roles: string[]; + email?: string; + userId?: string; + phone?: string; + url?: string; + name?: string; + }): Promise; /** - * Create a new organization API key. + * Invite a new member to join the current organization. An email with a link to join the organization will be sent to the new member's email address. If member doesn't exist in the project it will be automatically created. * - * @param {string} keyId - Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} name - Key name. Max length: 128 chars. - * @param {OrganizationKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string[]} roles - Array of strings. Use this param to set the user roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. + * @param {string} email - Email of the new organization member. + * @param {string} userId - ID of the user to be added to the organization. + * @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. + * @param {string} url - URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. + * @param {string} name - Name of the new organization member. Max length: 128 chars. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createKey( - keyId: string, - name: string, - scopes: OrganizationKeyScopes[], - expire?: string, - ): Promise; - createKey( + createMembership( + roles: string[], + email?: string, + userId?: string, + phone?: string, + url?: string, + name?: string, + ): Promise; + createMembership( paramsOrFirst: | { - keyId: string; - name: string; - scopes: OrganizationKeyScopes[]; - expire?: string; + roles: string[]; + email?: string; + userId?: string; + phone?: string; + url?: string; + name?: string; } - | string, - ...rest: [string?, OrganizationKeyScopes[]?, string?] - ): Promise { + | string[], + ...rest: [string?, string?, string?, string?, string?] + ): Promise { let params: { - keyId: string; - name: string; - scopes: OrganizationKeyScopes[]; - expire?: string; + roles: string[]; + email?: string; + userId?: string; + phone?: string; + url?: string; + name?: string; }; if ( @@ -557,46 +584,52 @@ export class Organization { !Array.isArray(paramsOrFirst) ) { params = (paramsOrFirst || {}) as { - keyId: string; - name: string; - scopes: OrganizationKeyScopes[]; - expire?: string; + roles: string[]; + email?: string; + userId?: string; + phone?: string; + url?: string; + name?: string; }; } else { params = { - keyId: paramsOrFirst as string, - name: rest[0] as string, - scopes: rest[1] as OrganizationKeyScopes[], - expire: rest[2] as string, + roles: paramsOrFirst as string[], + email: rest[0] as string, + userId: rest[1] as string, + phone: rest[2] as string, + url: rest[3] as string, + name: rest[4] as string, }; } - const keyId = params.keyId; + const roles = params.roles; + const email = params.email; + const userId = params.userId; + const phone = params.phone; + const url = params.url; const name = params.name; - const scopes = params.scopes; - const expire = params.expire; - if (typeof keyId === 'undefined') { - throw new AppwriteException('Missing required parameter: "keyId"'); + if (typeof roles === 'undefined') { + throw new AppwriteException('Missing required parameter: "roles"'); } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); + const apiPath = '/organization/memberships'; + const apiPayload: Payload = {}; + if (typeof email !== 'undefined') { + apiPayload['email'] = email; } - if (typeof scopes === 'undefined') { - throw new AppwriteException('Missing required parameter: "scopes"'); + if (typeof userId !== 'undefined') { + apiPayload['userId'] = userId; } - const apiPath = '/organization/keys'; - const apiPayload: Payload = {}; - if (typeof keyId !== 'undefined') { - apiPayload['keyId'] = keyId; + if (typeof phone !== 'undefined') { + apiPayload['phone'] = phone; } - if (typeof name !== 'undefined') { - apiPayload['name'] = name; + if (typeof roles !== 'undefined') { + apiPayload['roles'] = roles; } - if (typeof scopes !== 'undefined') { - apiPayload['scopes'] = scopes; + if (typeof url !== 'undefined') { + apiPayload['url'] = url; } - if (typeof expire !== 'undefined') { - apiPayload['expire'] = expire; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -610,44 +643,48 @@ export class Organization { } /** - * Get a key by its unique ID. This endpoint returns details about a specific API key in your organization including its scopes. + * Get a membership from the current organization by its unique ID. * - * @param {string} params.keyId - Key unique ID. + * @param {string} params.membershipId - Membership ID. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - getKey(params: { keyId: string }): Promise; + getMembership(params: { membershipId: string }): Promise; /** - * Get a key by its unique ID. This endpoint returns details about a specific API key in your organization including its scopes. + * Get a membership from the current organization by its unique ID. * - * @param {string} keyId - Key unique ID. + * @param {string} membershipId - Membership ID. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getKey(keyId: string): Promise; - getKey(paramsOrFirst: { keyId: string } | string): Promise { - let params: { keyId: string }; + getMembership(membershipId: string): Promise; + getMembership( + paramsOrFirst: { membershipId: string } | string, + ): Promise { + let params: { membershipId: string }; if ( paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) ) { - params = (paramsOrFirst || {}) as { keyId: string }; + params = (paramsOrFirst || {}) as { membershipId: string }; } else { params = { - keyId: paramsOrFirst as string, + membershipId: paramsOrFirst as string, }; } - const keyId = params.keyId; - if (typeof keyId === 'undefined') { - throw new AppwriteException('Missing required parameter: "keyId"'); + const membershipId = params.membershipId; + if (typeof membershipId === 'undefined' || membershipId === '') { + throw new AppwriteException( + 'Missing required parameter: "membershipId"', + ); } - const apiPath = '/organization/keys/{keyId}'.replace( - '{keyId}', - encodeURIComponent(String(keyId)), + const apiPath = '/organization/memberships/{membershipId}'.replace( + '{membershipId}', + encodeURIComponent(String(membershipId)), ); const apiPayload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -661,55 +698,35 @@ export class Organization { } /** - * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. + * Modify the roles of a member in the current organization. * - * @param {string} params.keyId - Key unique ID. - * @param {string} params.name - Key name. Max length: 128 chars. - * @param {OrganizationKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string} params.membershipId - Membership ID. + * @param {string[]} params.roles - An array of strings. Use this param to set the user's roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - updateKey(params: { - keyId: string; - name: string; - scopes: OrganizationKeyScopes[]; - expire?: string; - }): Promise; + updateMembership(params: { + membershipId: string; + roles: string[]; + }): Promise; /** - * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. + * Modify the roles of a member in the current organization. * - * @param {string} keyId - Key unique ID. - * @param {string} name - Key name. Max length: 128 chars. - * @param {OrganizationKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed. - * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @param {string} membershipId - Membership ID. + * @param {string[]} roles - An array of strings. Use this param to set the user's roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateKey( - keyId: string, - name: string, - scopes: OrganizationKeyScopes[], - expire?: string, - ): Promise; - updateKey( - paramsOrFirst: - | { - keyId: string; - name: string; - scopes: OrganizationKeyScopes[]; - expire?: string; - } - | string, - ...rest: [string?, OrganizationKeyScopes[]?, string?] - ): Promise { - let params: { - keyId: string; - name: string; - scopes: OrganizationKeyScopes[]; - expire?: string; - }; + updateMembership( + membershipId: string, + roles: string[], + ): Promise; + updateMembership( + paramsOrFirst: { membershipId: string; roles: string[] } | string, + ...rest: [string[]?] + ): Promise { + let params: { membershipId: string; roles: string[] }; if ( paramsOrFirst && @@ -717,46 +734,33 @@ export class Organization { !Array.isArray(paramsOrFirst) ) { params = (paramsOrFirst || {}) as { - keyId: string; - name: string; - scopes: OrganizationKeyScopes[]; - expire?: string; + membershipId: string; + roles: string[]; }; } else { params = { - keyId: paramsOrFirst as string, - name: rest[0] as string, - scopes: rest[1] as OrganizationKeyScopes[], - expire: rest[2] as string, + membershipId: paramsOrFirst as string, + roles: rest[0] as string[], }; } - const keyId = params.keyId; - const name = params.name; - const scopes = params.scopes; - const expire = params.expire; - if (typeof keyId === 'undefined') { - throw new AppwriteException('Missing required parameter: "keyId"'); + const membershipId = params.membershipId; + const roles = params.roles; + if (typeof membershipId === 'undefined' || membershipId === '') { + throw new AppwriteException( + 'Missing required parameter: "membershipId"', + ); } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof scopes === 'undefined') { - throw new AppwriteException('Missing required parameter: "scopes"'); + if (typeof roles === 'undefined') { + throw new AppwriteException('Missing required parameter: "roles"'); } - const apiPath = '/organization/keys/{keyId}'.replace( - '{keyId}', - encodeURIComponent(String(keyId)), + const apiPath = '/organization/memberships/{membershipId}'.replace( + '{membershipId}', + encodeURIComponent(String(membershipId)), ); const apiPayload: Payload = {}; - if (typeof name !== 'undefined') { - apiPayload['name'] = name; - } - if (typeof scopes !== 'undefined') { - apiPayload['scopes'] = scopes; - } - if (typeof expire !== 'undefined') { - apiPayload['expire'] = expire; + if (typeof roles !== 'undefined') { + apiPayload['roles'] = roles; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -766,48 +770,52 @@ export class Organization { accept: 'application/json', }; - return this.client.call('put', uri, apiHeaders, apiPayload); + return this.client.call('patch', uri, apiHeaders, apiPayload); } /** - * Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. + * Remove a member from the current organization. The member is removed whether they accepted the invitation or not; a pending invitation is revoked. * - * @param {string} params.keyId - Key unique ID. + * @param {string} params.membershipId - Membership ID. * @throws {AppwriteException} * @returns {Promise<{}>} */ - deleteKey(params: { keyId: string }): Promise<{}>; + deleteMembership(params: { membershipId: string }): Promise<{}>; /** - * Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. + * Remove a member from the current organization. The member is removed whether they accepted the invitation or not; a pending invitation is revoked. * - * @param {string} keyId - Key unique ID. + * @param {string} membershipId - Membership ID. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ - deleteKey(keyId: string): Promise<{}>; - deleteKey(paramsOrFirst: { keyId: string } | string): Promise<{}> { - let params: { keyId: string }; + deleteMembership(membershipId: string): Promise<{}>; + deleteMembership( + paramsOrFirst: { membershipId: string } | string, + ): Promise<{}> { + let params: { membershipId: string }; if ( paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) ) { - params = (paramsOrFirst || {}) as { keyId: string }; + params = (paramsOrFirst || {}) as { membershipId: string }; } else { params = { - keyId: paramsOrFirst as string, + membershipId: paramsOrFirst as string, }; } - const keyId = params.keyId; - if (typeof keyId === 'undefined') { - throw new AppwriteException('Missing required parameter: "keyId"'); + const membershipId = params.membershipId; + if (typeof membershipId === 'undefined' || membershipId === '') { + throw new AppwriteException( + 'Missing required parameter: "membershipId"', + ); } - const apiPath = '/organization/keys/{keyId}'.replace( - '{keyId}', - encodeURIComponent(String(keyId)), + const apiPath = '/organization/memberships/{membershipId}'.replace( + '{membershipId}', + encodeURIComponent(String(membershipId)), ); const apiPayload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -815,49 +823,50 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); } /** - * Get a list of all memberships from the current organization. + * Get a list of all projects. You can use the query params to filter your results. * - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search, accessedAt * @param {string} params.search - Search term to filter your list results. Max length: 256 chars. * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - listMemberships(params?: { + listProjects(params?: { queries?: string[]; search?: string; total?: boolean; - }): Promise; + }): Promise; /** - * Get a list of all memberships from the current organization. + * Get a list of all projects. You can use the query params to filter your results. * - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search, accessedAt * @param {string} search - Search term to filter your list results. Max length: 256 chars. * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - listMemberships( + listProjects( queries?: string[], search?: string, total?: boolean, - ): Promise; - listMemberships( + ): Promise; + listProjects( paramsOrFirst?: { queries?: string[]; search?: string; total?: boolean } | string[], ...rest: [string?, boolean?] - ): Promise { + ): Promise { let params: { queries?: string[]; search?: string; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -878,7 +887,7 @@ export class Organization { const queries = params.queries; const search = params.search; const total = params.total; - const apiPath = '/organization/memberships'; + const apiPath = '/organization/projects'; const apiPayload: Payload = {}; if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; @@ -900,67 +909,40 @@ export class Organization { } /** - * Invite a new member to join the current organization. An email with a link to join the organization will be sent to the new member's email address. If member doesn't exist in the project it will be automatically created. + * Create a new project. * - * @param {string[]} params.roles - Array of strings. Use this param to set the user roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. - * @param {string} params.email - Email of the new organization member. - * @param {string} params.userId - ID of the user to be added to the organization. - * @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. - * @param {string} params.url - URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. - * @param {string} params.name - Name of the new organization member. Max length: 128 chars. + * @param {string} params.projectId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Project name. Max length: 128 chars. + * @param {Region} params.region - Project Region. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - createMembership(params: { - roles: string[]; - email?: string; - userId?: string; - phone?: string; - url?: string; - name?: string; - }): Promise; + createProject(params: { + projectId: string; + name: string; + region?: Region; + }): Promise; /** - * Invite a new member to join the current organization. An email with a link to join the organization will be sent to the new member's email address. If member doesn't exist in the project it will be automatically created. + * Create a new project. * - * @param {string[]} roles - Array of strings. Use this param to set the user roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. - * @param {string} email - Email of the new organization member. - * @param {string} userId - ID of the user to be added to the organization. - * @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. - * @param {string} url - URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. - * @param {string} name - Name of the new organization member. Max length: 128 chars. + * @param {string} projectId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Project name. Max length: 128 chars. + * @param {Region} region - Project Region. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createMembership( - roles: string[], - email?: string, - userId?: string, - phone?: string, - url?: string, - name?: string, - ): Promise; - createMembership( + createProject( + projectId: string, + name: string, + region?: Region, + ): Promise; + createProject( paramsOrFirst: - | { - roles: string[]; - email?: string; - userId?: string; - phone?: string; - url?: string; - name?: string; - } - | string[], - ...rest: [string?, string?, string?, string?, string?] - ): Promise { - let params: { - roles: string[]; - email?: string; - userId?: string; - phone?: string; - url?: string; - name?: string; - }; + { projectId: string; name: string; region?: Region } | string, + ...rest: [string?, Region?] + ): Promise { + let params: { projectId: string; name: string; region?: Region }; if ( paramsOrFirst && @@ -968,53 +950,40 @@ export class Organization { !Array.isArray(paramsOrFirst) ) { params = (paramsOrFirst || {}) as { - roles: string[]; - email?: string; - userId?: string; - phone?: string; - url?: string; - name?: string; + projectId: string; + name: string; + region?: Region; }; } else { params = { - roles: paramsOrFirst as string[], - email: rest[0] as string, - userId: rest[1] as string, - phone: rest[2] as string, - url: rest[3] as string, - name: rest[4] as string, + projectId: paramsOrFirst as string, + name: rest[0] as string, + region: rest[1] as Region, }; } - const roles = params.roles; - const email = params.email; - const userId = params.userId; - const phone = params.phone; - const url = params.url; + const projectId = params.projectId; const name = params.name; - if (typeof roles === 'undefined') { - throw new AppwriteException('Missing required parameter: "roles"'); - } - const apiPath = '/organization/memberships'; - const apiPayload: Payload = {}; - if (typeof email !== 'undefined') { - apiPayload['email'] = email; - } - if (typeof userId !== 'undefined') { - apiPayload['userId'] = userId; - } - if (typeof phone !== 'undefined') { - apiPayload['phone'] = phone; + const region = params.region; + if (typeof projectId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "projectId"', + ); } - if (typeof roles !== 'undefined') { - apiPayload['roles'] = roles; + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); } - if (typeof url !== 'undefined') { - apiPayload['url'] = url; + const apiPath = '/organization/projects'; + const apiPayload: Payload = {}; + if (typeof projectId !== 'undefined') { + apiPayload['projectId'] = projectId; } if (typeof name !== 'undefined') { apiPayload['name'] = name; } + if (typeof region !== 'undefined') { + apiPayload['region'] = region; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1027,48 +996,48 @@ export class Organization { } /** - * Get a membership from the current organization by its unique ID. + * Get a project. * - * @param {string} params.membershipId - Membership ID. + * @param {string} params.projectId - Project unique ID. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - getMembership(params: { membershipId: string }): Promise; + getProject(params: { projectId: string }): Promise; /** - * Get a membership from the current organization by its unique ID. + * Get a project. * - * @param {string} membershipId - Membership ID. + * @param {string} projectId - Project unique ID. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getMembership(membershipId: string): Promise; - getMembership( - paramsOrFirst: { membershipId: string } | string, - ): Promise { - let params: { membershipId: string }; + getProject(projectId: string): Promise; + getProject( + paramsOrFirst: { projectId: string } | string, + ): Promise { + let params: { projectId: string }; if ( paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) ) { - params = (paramsOrFirst || {}) as { membershipId: string }; + params = (paramsOrFirst || {}) as { projectId: string }; } else { params = { - membershipId: paramsOrFirst as string, + projectId: paramsOrFirst as string, }; } - const membershipId = params.membershipId; - if (typeof membershipId === 'undefined') { + const projectId = params.projectId; + if (typeof projectId === 'undefined' || projectId === '') { throw new AppwriteException( - 'Missing required parameter: "membershipId"', + 'Missing required parameter: "projectId"', ); } - const apiPath = '/organization/memberships/{membershipId}'.replace( - '{membershipId}', - encodeURIComponent(String(membershipId)), + const apiPath = '/organization/projects/{projectId}'.replace( + '{projectId}', + encodeURIComponent(String(projectId)), ); const apiPayload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1082,35 +1051,32 @@ export class Organization { } /** - * Modify the roles of a member in the current organization. + * Update a project by its unique ID. * - * @param {string} params.membershipId - Membership ID. - * @param {string[]} params.roles - An array of strings. Use this param to set the user's roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. + * @param {string} params.projectId - Project unique ID. + * @param {string} params.name - Project name. Max length: 128 chars. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - updateMembership(params: { - membershipId: string; - roles: string[]; - }): Promise; + updateProject(params: { + projectId: string; + name: string; + }): Promise; /** - * Modify the roles of a member in the current organization. + * Update a project by its unique ID. * - * @param {string} membershipId - Membership ID. - * @param {string[]} roles - An array of strings. Use this param to set the user's roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. + * @param {string} projectId - Project unique ID. + * @param {string} name - Project name. Max length: 128 chars. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateMembership( - membershipId: string, - roles: string[], - ): Promise; - updateMembership( - paramsOrFirst: { membershipId: string; roles: string[] } | string, - ...rest: [string[]?] - ): Promise { - let params: { membershipId: string; roles: string[] }; + updateProject(projectId: string, name: string): Promise; + updateProject( + paramsOrFirst: { projectId: string; name: string } | string, + ...rest: [string?] + ): Promise { + let params: { projectId: string; name: string }; if ( paramsOrFirst && @@ -1118,33 +1084,33 @@ export class Organization { !Array.isArray(paramsOrFirst) ) { params = (paramsOrFirst || {}) as { - membershipId: string; - roles: string[]; + projectId: string; + name: string; }; } else { params = { - membershipId: paramsOrFirst as string, - roles: rest[0] as string[], + projectId: paramsOrFirst as string, + name: rest[0] as string, }; } - const membershipId = params.membershipId; - const roles = params.roles; - if (typeof membershipId === 'undefined') { + const projectId = params.projectId; + const name = params.name; + if (typeof projectId === 'undefined' || projectId === '') { throw new AppwriteException( - 'Missing required parameter: "membershipId"', + 'Missing required parameter: "projectId"', ); } - if (typeof roles === 'undefined') { - throw new AppwriteException('Missing required parameter: "roles"'); + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/organization/memberships/{membershipId}'.replace( - '{membershipId}', - encodeURIComponent(String(membershipId)), + const apiPath = '/organization/projects/{projectId}'.replace( + '{projectId}', + encodeURIComponent(String(projectId)), ); const apiPayload: Payload = {}; - if (typeof roles !== 'undefined') { - apiPayload['roles'] = roles; + if (typeof name !== 'undefined') { + apiPayload['name'] = name; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -1158,48 +1124,46 @@ export class Organization { } /** - * Remove a member from the current organization. The member is removed whether they accepted the invitation or not; a pending invitation is revoked. + * Delete a project by its unique ID. * - * @param {string} params.membershipId - Membership ID. + * @param {string} params.projectId - Project unique ID. * @throws {AppwriteException} * @returns {Promise<{}>} */ - deleteMembership(params: { membershipId: string }): Promise<{}>; + deleteProject(params: { projectId: string }): Promise<{}>; /** - * Remove a member from the current organization. The member is removed whether they accepted the invitation or not; a pending invitation is revoked. + * Delete a project by its unique ID. * - * @param {string} membershipId - Membership ID. + * @param {string} projectId - Project unique ID. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ - deleteMembership(membershipId: string): Promise<{}>; - deleteMembership( - paramsOrFirst: { membershipId: string } | string, - ): Promise<{}> { - let params: { membershipId: string }; + deleteProject(projectId: string): Promise<{}>; + deleteProject(paramsOrFirst: { projectId: string } | string): Promise<{}> { + let params: { projectId: string }; if ( paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) ) { - params = (paramsOrFirst || {}) as { membershipId: string }; + params = (paramsOrFirst || {}) as { projectId: string }; } else { params = { - membershipId: paramsOrFirst as string, + projectId: paramsOrFirst as string, }; } - const membershipId = params.membershipId; - if (typeof membershipId === 'undefined') { + const projectId = params.projectId; + if (typeof projectId === 'undefined' || projectId === '') { throw new AppwriteException( - 'Missing required parameter: "membershipId"', + 'Missing required parameter: "projectId"', ); } - const apiPath = '/organization/memberships/{membershipId}'.replace( - '{membershipId}', - encodeURIComponent(String(membershipId)), + const apiPath = '/organization/projects/{projectId}'.replace( + '{projectId}', + encodeURIComponent(String(projectId)), ); const apiPayload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1207,77 +1171,82 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); } /** - * Get a list of all projects. You can use the query params to filter your results. + * Get a list of all API keys of a project in your organization. * - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search, accessedAt - * @param {string} params.search - Search term to filter your list results. Max length: 256 chars. + * @param {string} params.projectId - Project unique ID. + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - listProjects(params?: { + listProjectKeys(params: { + projectId: string; queries?: string[]; - search?: string; total?: boolean; - }): Promise; + }): Promise; /** - * Get a list of all projects. You can use the query params to filter your results. + * Get a list of all API keys of a project in your organization. * - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search, accessedAt - * @param {string} search - Search term to filter your list results. Max length: 256 chars. + * @param {string} projectId - Project unique ID. + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - listProjects( + listProjectKeys( + projectId: string, queries?: string[], - search?: string, total?: boolean, - ): Promise; - listProjects( - paramsOrFirst?: - { queries?: string[]; search?: string; total?: boolean } | string[], - ...rest: [string?, boolean?] - ): Promise { - let params: { queries?: string[]; search?: string; total?: boolean }; + ): Promise; + listProjectKeys( + paramsOrFirst: + { projectId: string; queries?: string[]; total?: boolean } | string, + ...rest: [string[]?, boolean?] + ): Promise { + let params: { projectId: string; queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || - (paramsOrFirst && - typeof paramsOrFirst === 'object' && - !Array.isArray(paramsOrFirst)) + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) ) { params = (paramsOrFirst || {}) as { + projectId: string; queries?: string[]; - search?: string; total?: boolean; }; } else { params = { - queries: paramsOrFirst as string[], - search: rest[0] as string, + projectId: paramsOrFirst as string, + queries: rest[0] as string[], total: rest[1] as boolean, }; } + const projectId = params.projectId; const queries = params.queries; - const search = params.search; const total = params.total; - const apiPath = '/organization/projects'; + if (typeof projectId === 'undefined' || projectId === '') { + throw new AppwriteException( + 'Missing required parameter: "projectId"', + ); + } + const apiPath = '/organization/projects/{projectId}/keys'.replace( + '{projectId}', + encodeURIComponent(String(projectId)), + ); const apiPayload: Payload = {}; if (typeof queries !== 'undefined') { apiPayload['queries'] = queries; } - if (typeof search !== 'undefined') { - apiPayload['search'] = search; - } if (typeof total !== 'undefined') { apiPayload['total'] = total; } @@ -1292,40 +1261,53 @@ export class Organization { } /** - * Create a new project. + * Create a new ephemeral API key for a project in your organization. It's recommended to have multiple API keys with strict scopes for separate functions within your project. * - * @param {string} params.projectId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars. - * @param {string} params.name - Project name. Max length: 128 chars. - * @param {Region} params.region - Project Region. + * You can also create a standard API key if you need a longer-lived key instead. + * + * @param {string} params.projectId - Project unique ID. + * @param {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed. + * @param {number} params.duration - Time in seconds before ephemeral key expires. Maximum duration is 3600 seconds. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - createProject(params: { + createEphemeralProjectKey(params: { projectId: string; - name: string; - region?: Region; - }): Promise; + scopes: ProjectKeyScopes[]; + duration: number; + }): Promise; /** - * Create a new project. + * Create a new ephemeral API key for a project in your organization. It's recommended to have multiple API keys with strict scopes for separate functions within your project. * - * @param {string} projectId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars. - * @param {string} name - Project name. Max length: 128 chars. - * @param {Region} region - Project Region. + * You can also create a standard API key if you need a longer-lived key instead. + * + * @param {string} projectId - Project unique ID. + * @param {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed. + * @param {number} duration - Time in seconds before ephemeral key expires. Maximum duration is 3600 seconds. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createProject( + createEphemeralProjectKey( projectId: string, - name: string, - region?: Region, - ): Promise; - createProject( + scopes: ProjectKeyScopes[], + duration: number, + ): Promise; + createEphemeralProjectKey( paramsOrFirst: - { projectId: string; name: string; region?: Region } | string, - ...rest: [string?, Region?] - ): Promise { - let params: { projectId: string; name: string; region?: Region }; + | { + projectId: string; + scopes: ProjectKeyScopes[]; + duration: number; + } + | string, + ...rest: [ProjectKeyScopes[]?, number?] + ): Promise { + let params: { + projectId: string; + scopes: ProjectKeyScopes[]; + duration: number; + }; if ( paramsOrFirst && @@ -1334,38 +1316,44 @@ export class Organization { ) { params = (paramsOrFirst || {}) as { projectId: string; - name: string; - region?: Region; + scopes: ProjectKeyScopes[]; + duration: number; }; } else { params = { projectId: paramsOrFirst as string, - name: rest[0] as string, - region: rest[1] as Region, + scopes: rest[0] as ProjectKeyScopes[], + duration: rest[1] as number, }; } const projectId = params.projectId; - const name = params.name; - const region = params.region; - if (typeof projectId === 'undefined') { + const scopes = params.scopes; + const duration = params.duration; + if (typeof projectId === 'undefined' || projectId === '') { throw new AppwriteException( 'Missing required parameter: "projectId"', ); } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); + if (typeof scopes === 'undefined') { + throw new AppwriteException('Missing required parameter: "scopes"'); } - const apiPath = '/organization/projects'; - const apiPayload: Payload = {}; - if (typeof projectId !== 'undefined') { - apiPayload['projectId'] = projectId; + if (typeof duration === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "duration"', + ); } - if (typeof name !== 'undefined') { - apiPayload['name'] = name; + const apiPath = + '/organization/projects/{projectId}/keys/ephemeral'.replace( + '{projectId}', + encodeURIComponent(String(projectId)), + ); + const apiPayload: Payload = {}; + if (typeof scopes !== 'undefined') { + apiPayload['scopes'] = scopes; } - if (typeof region !== 'undefined') { - apiPayload['region'] = region; + if (typeof duration !== 'undefined') { + apiPayload['duration'] = duration; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -1379,86 +1367,129 @@ export class Organization { } /** - * Get a project. + * Get a project key by its unique ID. * * @param {string} params.projectId - Project unique ID. + * @param {string} params.keyId - Key ID. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - getProject(params: { projectId: string }): Promise; + getProjectKey(params: { + projectId: string; + keyId: string; + }): Promise; /** - * Get a project. + * Get a project key by its unique ID. * * @param {string} projectId - Project unique ID. + * @param {string} keyId - Key ID. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getProject(projectId: string): Promise; - getProject( - paramsOrFirst: { projectId: string } | string, - ): Promise { - let params: { projectId: string }; + getProjectKey(projectId: string, keyId: string): Promise; + getProjectKey( + paramsOrFirst: { projectId: string; keyId: string } | string, + ...rest: [string?] + ): Promise { + let params: { projectId: string; keyId: string }; if ( paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) ) { - params = (paramsOrFirst || {}) as { projectId: string }; + params = (paramsOrFirst || {}) as { + projectId: string; + keyId: string; + }; } else { params = { projectId: paramsOrFirst as string, + keyId: rest[0] as string, }; } const projectId = params.projectId; - if (typeof projectId === 'undefined') { + const keyId = params.keyId; + if (typeof projectId === 'undefined' || projectId === '') { throw new AppwriteException( 'Missing required parameter: "projectId"', ); } - const apiPath = '/organization/projects/{projectId}'.replace( - '{projectId}', - encodeURIComponent(String(projectId)), - ); + if (typeof keyId === 'undefined' || keyId === '') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + const apiPath = '/organization/projects/{projectId}/keys/{keyId}' + .replace('{projectId}', encodeURIComponent(String(projectId))) + .replace('{keyId}', encodeURIComponent(String(keyId))); const apiPayload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', }; return this.client.call('get', uri, apiHeaders, apiPayload); } /** - * Update a project by its unique ID. + * Update a project key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. * * @param {string} params.projectId - Project unique ID. - * @param {string} params.name - Project name. Max length: 128 chars. + * @param {string} params.keyId - Key ID. + * @param {string} params.name - Key name. Max length: 128 chars. + * @param {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed. + * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - updateProject(params: { + updateProjectKey(params: { projectId: string; + keyId: string; name: string; - }): Promise; + scopes: ProjectKeyScopes[]; + expire?: string; + }): Promise; /** - * Update a project by its unique ID. + * Update a project key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. * * @param {string} projectId - Project unique ID. - * @param {string} name - Project name. Max length: 128 chars. + * @param {string} keyId - Key ID. + * @param {string} name - Key name. Max length: 128 chars. + * @param {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed. + * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateProject(projectId: string, name: string): Promise; - updateProject( - paramsOrFirst: { projectId: string; name: string } | string, - ...rest: [string?] - ): Promise { - let params: { projectId: string; name: string }; + updateProjectKey( + projectId: string, + keyId: string, + name: string, + scopes: ProjectKeyScopes[], + expire?: string, + ): Promise; + updateProjectKey( + paramsOrFirst: + | { + projectId: string; + keyId: string; + name: string; + scopes: ProjectKeyScopes[]; + expire?: string; + } + | string, + ...rest: [string?, string?, ProjectKeyScopes[]?, string?] + ): Promise { + let params: { + projectId: string; + keyId: string; + name: string; + scopes: ProjectKeyScopes[]; + expire?: string; + }; if ( paramsOrFirst && @@ -1467,33 +1498,53 @@ export class Organization { ) { params = (paramsOrFirst || {}) as { projectId: string; + keyId: string; name: string; + scopes: ProjectKeyScopes[]; + expire?: string; }; } else { params = { projectId: paramsOrFirst as string, - name: rest[0] as string, + keyId: rest[0] as string, + name: rest[1] as string, + scopes: rest[2] as ProjectKeyScopes[], + expire: rest[3] as string, }; } const projectId = params.projectId; + const keyId = params.keyId; const name = params.name; - if (typeof projectId === 'undefined') { + const scopes = params.scopes; + const expire = params.expire; + if (typeof projectId === 'undefined' || projectId === '') { throw new AppwriteException( 'Missing required parameter: "projectId"', ); } + if (typeof keyId === 'undefined' || keyId === '') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/organization/projects/{projectId}'.replace( - '{projectId}', - encodeURIComponent(String(projectId)), - ); + if (typeof scopes === 'undefined') { + throw new AppwriteException('Missing required parameter: "scopes"'); + } + const apiPath = '/organization/projects/{projectId}/keys/{keyId}' + .replace('{projectId}', encodeURIComponent(String(projectId))) + .replace('{keyId}', encodeURIComponent(String(keyId))); const apiPayload: Payload = {}; if (typeof name !== 'undefined') { apiPayload['name'] = name; } + if (typeof scopes !== 'undefined') { + apiPayload['scopes'] = scopes; + } + if (typeof expire !== 'undefined') { + apiPayload['expire'] = expire; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1502,57 +1553,70 @@ export class Organization { accept: 'application/json', }; - return this.client.call('patch', uri, apiHeaders, apiPayload); + return this.client.call('put', uri, apiHeaders, apiPayload); } /** - * Delete a project by its unique ID. + * Delete a project key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. * * @param {string} params.projectId - Project unique ID. + * @param {string} params.keyId - Key ID. * @throws {AppwriteException} * @returns {Promise<{}>} */ - deleteProject(params: { projectId: string }): Promise<{}>; + deleteProjectKey(params: { projectId: string; keyId: string }): Promise<{}>; /** - * Delete a project by its unique ID. + * Delete a project key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. * * @param {string} projectId - Project unique ID. + * @param {string} keyId - Key ID. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ - deleteProject(projectId: string): Promise<{}>; - deleteProject(paramsOrFirst: { projectId: string } | string): Promise<{}> { - let params: { projectId: string }; + deleteProjectKey(projectId: string, keyId: string): Promise<{}>; + deleteProjectKey( + paramsOrFirst: { projectId: string; keyId: string } | string, + ...rest: [string?] + ): Promise<{}> { + let params: { projectId: string; keyId: string }; if ( paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) ) { - params = (paramsOrFirst || {}) as { projectId: string }; + params = (paramsOrFirst || {}) as { + projectId: string; + keyId: string; + }; } else { params = { projectId: paramsOrFirst as string, + keyId: rest[0] as string, }; } const projectId = params.projectId; - if (typeof projectId === 'undefined') { + const keyId = params.keyId; + if (typeof projectId === 'undefined' || projectId === '') { throw new AppwriteException( 'Missing required parameter: "projectId"', ); } - const apiPath = '/organization/projects/{projectId}'.replace( - '{projectId}', - encodeURIComponent(String(projectId)), - ); + if (typeof keyId === 'undefined' || keyId === '') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + const apiPath = '/organization/projects/{projectId}/keys/{keyId}' + .replace('{projectId}', encodeURIComponent(String(projectId))) + .replace('{keyId}', encodeURIComponent(String(keyId))); const apiPayload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); diff --git a/src/services/postgresql.ts b/src/services/postgresql.ts index 330ee277..ec5659b2 100644 --- a/src/services/postgresql.ts +++ b/src/services/postgresql.ts @@ -33,7 +33,7 @@ export class Postgresql { let params: { queries?: string[] }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -77,7 +77,7 @@ export class Postgresql { * @param {number} params.pitrRetentionDays - Number of days to retain PITR data. * @param {boolean} params.storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. * @param {number} params.storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. + * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. * @throws {AppwriteException} * @returns {Promise} */ @@ -113,7 +113,7 @@ export class Postgresql { * @param {number} pitrRetentionDays - Number of days to retain PITR data. * @param {boolean} storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. * @param {number} storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. - * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. + * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. Defaults to 3 times the specification's storage. 0 means no limit. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -306,7 +306,7 @@ export class Postgresql { } /** - * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, pricing, and whether it is enabled for the organization. + * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, its own prices and overage rates, and whether it is enabled for the organization. * * @throws {AppwriteException} * @returns {Promise} @@ -359,7 +359,7 @@ export class Postgresql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -630,7 +630,7 @@ export class Postgresql { const sqlApiMaxRows = params.sqlApiMaxRows; const sqlApiMaxBytes = params.sqlApiMaxBytes; const sqlApiTimeoutSeconds = params.sqlApiTimeoutSeconds; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -746,7 +746,7 @@ export class Postgresql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -816,7 +816,7 @@ export class Postgresql { const databaseId = params.databaseId; const queries = params.queries; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -888,7 +888,7 @@ export class Postgresql { const databaseId = params.databaseId; const type = params.type; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -961,7 +961,7 @@ export class Postgresql { const databaseId = params.databaseId; const queries = params.queries; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1086,7 +1086,7 @@ export class Postgresql { const retention = params.retention; const type = params.type; const enabled = params.enabled; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1192,12 +1192,12 @@ export class Postgresql { const databaseId = params.databaseId; const policyId = params.policyId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof policyId === 'undefined') { + if (typeof policyId === 'undefined' || policyId === '') { throw new AppwriteException( 'Missing required parameter: "policyId"', ); @@ -1309,12 +1309,12 @@ export class Postgresql { const schedule = params.schedule; const retention = params.retention; const enabled = params.enabled; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof policyId === 'undefined') { + if (typeof policyId === 'undefined' || policyId === '') { throw new AppwriteException( 'Missing required parameter: "policyId"', ); @@ -1392,12 +1392,12 @@ export class Postgresql { const databaseId = params.databaseId; const policyId = params.policyId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof policyId === 'undefined') { + if (typeof policyId === 'undefined' || policyId === '') { throw new AppwriteException( 'Missing required parameter: "policyId"', ); @@ -1528,7 +1528,7 @@ export class Postgresql { const region = params.region; const prefix = params.prefix; const endpoint = params.endpoint; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1637,12 +1637,12 @@ export class Postgresql { const databaseId = params.databaseId; const backupId = params.backupId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof backupId === 'undefined') { + if (typeof backupId === 'undefined' || backupId === '') { throw new AppwriteException( 'Missing required parameter: "backupId"', ); @@ -1704,12 +1704,12 @@ export class Postgresql { const databaseId = params.databaseId; const backupId = params.backupId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof backupId === 'undefined') { + if (typeof backupId === 'undefined' || backupId === '') { throw new AppwriteException( 'Missing required parameter: "backupId"', ); @@ -1768,7 +1768,7 @@ export class Postgresql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1845,7 +1845,7 @@ export class Postgresql { const databaseId = params.databaseId; const branchId = params.branchId; const ttl = params.ttl; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1921,12 +1921,12 @@ export class Postgresql { const databaseId = params.databaseId; const branchId = params.branchId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof branchId === 'undefined') { + if (typeof branchId === 'undefined' || branchId === '') { throw new AppwriteException( 'Missing required parameter: "branchId"', ); @@ -1985,7 +1985,7 @@ export class Postgresql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2081,7 +2081,7 @@ export class Postgresql { const sql = params.sql; const bindings = params.bindings; const timeoutSeconds = params.timeoutSeconds; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2153,7 +2153,7 @@ export class Postgresql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2222,7 +2222,7 @@ export class Postgresql { const databaseId = params.databaseId; const name = params.name; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2298,12 +2298,12 @@ export class Postgresql { const databaseId = params.databaseId; const extensionName = params.extensionName; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof extensionName === 'undefined') { + if (typeof extensionName === 'undefined' || extensionName === '') { throw new AppwriteException( 'Missing required parameter: "extensionName"', ); @@ -2376,7 +2376,7 @@ export class Postgresql { const databaseId = params.databaseId; const targetReplicaId = params.targetReplicaId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2457,7 +2457,7 @@ export class Postgresql { const databaseId = params.databaseId; const day = params.day; const hourUtc = params.hourUtc; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2554,7 +2554,7 @@ export class Postgresql { const databaseId = params.databaseId; const targetType = params.targetType; const specification = params.specification; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2661,7 +2661,7 @@ export class Postgresql { const status = params.status; const limit = params.limit; const offset = params.offset; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2727,7 +2727,7 @@ export class Postgresql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2784,7 +2784,7 @@ export class Postgresql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -2933,7 +2933,7 @@ export class Postgresql { const poolerCpuLimit = params.poolerCpuLimit; const poolerMemoryRequest = params.poolerMemoryRequest; const poolerMemoryLimit = params.poolerMemoryLimit; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -3015,7 +3015,7 @@ export class Postgresql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -3119,7 +3119,7 @@ export class Postgresql { const type = params.type; const limit = params.limit; const offset = params.offset; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -3235,7 +3235,7 @@ export class Postgresql { const backupId = params.backupId; const targetDatabaseId = params.targetDatabaseId; const targetTime = params.targetTime; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -3317,12 +3317,12 @@ export class Postgresql { const databaseId = params.databaseId; const restorationId = params.restorationId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof restorationId === 'undefined') { + if (typeof restorationId === 'undefined' || restorationId === '') { throw new AppwriteException( 'Missing required parameter: "restorationId"', ); @@ -3379,7 +3379,7 @@ export class Postgresql { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -3448,7 +3448,7 @@ export class Postgresql { const databaseId = params.databaseId; const targetVersion = params.targetVersion; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); diff --git a/src/services/presences.ts b/src/services/presences.ts index eb155365..eced57c7 100644 --- a/src/services/presences.ts +++ b/src/services/presences.ts @@ -47,7 +47,7 @@ export class Presences { let params: { queries?: string[]; total?: boolean; ttl?: number }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -126,7 +126,7 @@ export class Presences { } const presenceId = params.presenceId; - if (typeof presenceId === 'undefined') { + if (typeof presenceId === 'undefined' || presenceId === '') { throw new AppwriteException( 'Missing required parameter: "presenceId"', ); @@ -241,7 +241,7 @@ export class Presences { const permissions = params.permissions; const expiresAt = params.expiresAt; const metadata = params.metadata; - if (typeof presenceId === 'undefined') { + if (typeof presenceId === 'undefined' || presenceId === '') { throw new AppwriteException( 'Missing required parameter: "presenceId"', ); @@ -387,7 +387,7 @@ export class Presences { const metadata = params.metadata; const permissions = params.permissions; const purge = params.purge; - if (typeof presenceId === 'undefined') { + if (typeof presenceId === 'undefined' || presenceId === '') { throw new AppwriteException( 'Missing required parameter: "presenceId"', ); @@ -464,7 +464,7 @@ export class Presences { } const presenceId = params.presenceId; - if (typeof presenceId === 'undefined') { + if (typeof presenceId === 'undefined' || presenceId === '') { throw new AppwriteException( 'Missing required parameter: "presenceId"', ); @@ -479,6 +479,7 @@ export class Presences { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); diff --git a/src/services/project.ts b/src/services/project.ts index cc63f312..337db051 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -32,6 +32,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', }; return this.client.call('get', uri, apiHeaders, apiPayload); @@ -51,6 +52,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -166,7 +168,7 @@ export class Project { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -318,7 +320,7 @@ export class Project { } const keyId = params.keyId; - if (typeof keyId === 'undefined') { + if (typeof keyId === 'undefined' || keyId === '') { throw new AppwriteException('Missing required parameter: "keyId"'); } const apiPath = '/project/keys/{keyId}'.replace( @@ -411,7 +413,7 @@ export class Project { const name = params.name; const scopes = params.scopes; const expire = params.expire; - if (typeof keyId === 'undefined') { + if (typeof keyId === 'undefined' || keyId === '') { throw new AppwriteException('Missing required parameter: "keyId"'); } if (typeof name === 'undefined') { @@ -478,7 +480,7 @@ export class Project { } const keyId = params.keyId; - if (typeof keyId === 'undefined') { + if (typeof keyId === 'undefined' || keyId === '') { throw new AppwriteException('Missing required parameter: "keyId"'); } const apiPath = '/project/keys/{keyId}'.replace( @@ -491,6 +493,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -582,7 +585,7 @@ export class Project { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -721,7 +724,7 @@ export class Project { } const number = params.number; - if (typeof number === 'undefined') { + if (typeof number === 'undefined' || number === '') { throw new AppwriteException('Missing required parameter: "number"'); } const apiPath = '/project/mock-phones/{number}'.replace( @@ -782,7 +785,7 @@ export class Project { const number = params.number; const otp = params.otp; - if (typeof number === 'undefined') { + if (typeof number === 'undefined' || number === '') { throw new AppwriteException('Missing required parameter: "number"'); } if (typeof otp === 'undefined') { @@ -840,7 +843,7 @@ export class Project { } const number = params.number; - if (typeof number === 'undefined') { + if (typeof number === 'undefined' || number === '') { throw new AppwriteException('Missing required parameter: "number"'); } const apiPath = '/project/mock-phones/{number}'.replace( @@ -853,6 +856,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -890,7 +894,7 @@ export class Project { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -1241,7 +1245,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -1291,7 +1295,9 @@ export class Project { * @param {string} params.keyId - 'Key ID' of Apple OAuth2 app. For example: P4000000N8 * @param {string} params.teamId - 'Team ID' of Apple OAuth2 app. For example: D4000000R6 * @param {string} params.p8File - Contents of the Apple OAuth2 app .p8 private key file. The secret key wrapped by the PEM markers is 200 characters long. For example: -----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY----- - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string[]} params.nativeClientIds - App bundle IDs accepted as ID token audiences for native Sign in with Apple. For example: com.example.app. Together with the Services ID, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list. + * @param {boolean} params.enabled - Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only. + * @param {boolean} params.nativeEnabled - Native Sign in with Apple status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a Services ID or at least one native client ID to match tokens against, but no key or team ID: this method verifies a signature rather than redeeming an authorization code. * @throws {AppwriteException} * @returns {Promise} */ @@ -1300,7 +1306,9 @@ export class Project { keyId?: string; teamId?: string; p8File?: string; + nativeClientIds?: string[]; enabled?: boolean; + nativeEnabled?: boolean; }): Promise; /** * Update the project OAuth2 Apple configuration. @@ -1309,7 +1317,9 @@ export class Project { * @param {string} keyId - 'Key ID' of Apple OAuth2 app. For example: P4000000N8 * @param {string} teamId - 'Team ID' of Apple OAuth2 app. For example: D4000000R6 * @param {string} p8File - Contents of the Apple OAuth2 app .p8 private key file. The secret key wrapped by the PEM markers is 200 characters long. For example: -----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY----- - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string[]} nativeClientIds - App bundle IDs accepted as ID token audiences for native Sign in with Apple. For example: com.example.app. Together with the Services ID, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list. + * @param {boolean} enabled - Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only. + * @param {boolean} nativeEnabled - Native Sign in with Apple status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a Services ID or at least one native client ID to match tokens against, but no key or team ID: this method verifies a signature rather than redeeming an authorization code. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -1319,7 +1329,9 @@ export class Project { keyId?: string, teamId?: string, p8File?: string, + nativeClientIds?: string[], enabled?: boolean, + nativeEnabled?: boolean, ): Promise; updateOAuth2Apple( paramsOrFirst?: @@ -1328,21 +1340,25 @@ export class Project { keyId?: string; teamId?: string; p8File?: string; + nativeClientIds?: string[]; enabled?: boolean; + nativeEnabled?: boolean; } | string, - ...rest: [string?, string?, string?, boolean?] + ...rest: [string?, string?, string?, string[]?, boolean?, boolean?] ): Promise { let params: { serviceId?: string; keyId?: string; teamId?: string; p8File?: string; + nativeClientIds?: string[]; enabled?: boolean; + nativeEnabled?: boolean; }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -1352,7 +1368,9 @@ export class Project { keyId?: string; teamId?: string; p8File?: string; + nativeClientIds?: string[]; enabled?: boolean; + nativeEnabled?: boolean; }; } else { params = { @@ -1360,7 +1378,9 @@ export class Project { keyId: rest[0] as string, teamId: rest[1] as string, p8File: rest[2] as string, - enabled: rest[3] as boolean, + nativeClientIds: rest[3] as string[], + enabled: rest[4] as boolean, + nativeEnabled: rest[5] as boolean, }; } @@ -1368,7 +1388,9 @@ export class Project { const keyId = params.keyId; const teamId = params.teamId; const p8File = params.p8File; + const nativeClientIds = params.nativeClientIds; const enabled = params.enabled; + const nativeEnabled = params.nativeEnabled; const apiPath = '/project/oauth2/apple'; const apiPayload: Payload = {}; if (typeof serviceId !== 'undefined') { @@ -1383,9 +1405,15 @@ export class Project { if (typeof p8File !== 'undefined') { apiPayload['p8File'] = p8File; } + if (typeof nativeClientIds !== 'undefined') { + apiPayload['nativeClientIds'] = nativeClientIds; + } if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof nativeEnabled !== 'undefined') { + apiPayload['nativeEnabled'] = nativeEnabled; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1439,7 +1467,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -1534,7 +1562,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -1635,7 +1663,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -1726,7 +1754,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -1806,7 +1834,7 @@ export class Project { let params: { key?: string; secret?: string; enabled?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -1891,7 +1919,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -1976,7 +2004,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -2061,7 +2089,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -2141,7 +2169,7 @@ export class Project { let params: { apiKey?: string; apiSecret?: string; enabled?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -2226,7 +2254,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -2311,7 +2339,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -2391,7 +2419,7 @@ export class Project { let params: { appKey?: string; appSecret?: string; enabled?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -2476,7 +2504,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -2556,7 +2584,7 @@ export class Project { let params: { appId?: string; appSecret?: string; enabled?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -2641,7 +2669,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -2736,7 +2764,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -2827,7 +2855,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -2922,7 +2950,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -2977,7 +3005,9 @@ export class Project { * @param {string} params.clientId - 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com * @param {string} params.clientSecret - 'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj * @param {ProjectOAuth2GooglePrompt[]} params.prompt - Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. - * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string[]} params.nativeClientIds - Additional OAuth2 client IDs accepted as ID token audiences for native sign-in (Android and iOS client IDs). Together with the client ID, which is always accepted, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list. + * @param {boolean} params.enabled - Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only. + * @param {boolean} params.nativeEnabled - Native Google sign-in status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a client ID or at least one native client ID to match tokens against, but no client secret: this method verifies a signature rather than redeeming an authorization code. * @throws {AppwriteException} * @returns {Promise} */ @@ -2985,7 +3015,9 @@ export class Project { clientId?: string; clientSecret?: string; prompt?: ProjectOAuth2GooglePrompt[]; + nativeClientIds?: string[]; enabled?: boolean; + nativeEnabled?: boolean; }): Promise; /** * Update the project OAuth2 Google configuration. @@ -2993,7 +3025,9 @@ export class Project { * @param {string} clientId - 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com * @param {string} clientSecret - 'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj * @param {ProjectOAuth2GooglePrompt[]} prompt - Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. - * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @param {string[]} nativeClientIds - Additional OAuth2 client IDs accepted as ID token audiences for native sign-in (Android and iOS client IDs). Together with the client ID, which is always accepted, these are the only client IDs whose tokens are trusted. Pass an empty array to clear the list. + * @param {boolean} enabled - Browser-based OAuth2 sign-in status. Set to true to enable new session creation through the redirect flow. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. Has no effect on native sign-in, which is controlled by nativeEnabled only. + * @param {boolean} nativeEnabled - Native Google sign-in status. This is the only switch for creating sessions from ID tokens obtained on device and is independent of enabled. Needs a client ID or at least one native client ID to match tokens against, but no client secret: this method verifies a signature rather than redeeming an authorization code. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -3002,7 +3036,9 @@ export class Project { clientId?: string, clientSecret?: string, prompt?: ProjectOAuth2GooglePrompt[], + nativeClientIds?: string[], enabled?: boolean, + nativeEnabled?: boolean, ): Promise; updateOAuth2Google( paramsOrFirst?: @@ -3010,20 +3046,30 @@ export class Project { clientId?: string; clientSecret?: string; prompt?: ProjectOAuth2GooglePrompt[]; + nativeClientIds?: string[]; enabled?: boolean; + nativeEnabled?: boolean; } | string, - ...rest: [string?, ProjectOAuth2GooglePrompt[]?, boolean?] + ...rest: [ + string?, + ProjectOAuth2GooglePrompt[]?, + string[]?, + boolean?, + boolean?, + ] ): Promise { let params: { clientId?: string; clientSecret?: string; prompt?: ProjectOAuth2GooglePrompt[]; + nativeClientIds?: string[]; enabled?: boolean; + nativeEnabled?: boolean; }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -3032,21 +3078,27 @@ export class Project { clientId?: string; clientSecret?: string; prompt?: ProjectOAuth2GooglePrompt[]; + nativeClientIds?: string[]; enabled?: boolean; + nativeEnabled?: boolean; }; } else { params = { clientId: paramsOrFirst as string, clientSecret: rest[0] as string, prompt: rest[1] as ProjectOAuth2GooglePrompt[], - enabled: rest[2] as boolean, + nativeClientIds: rest[2] as string[], + enabled: rest[3] as boolean, + nativeEnabled: rest[4] as boolean, }; } const clientId = params.clientId; const clientSecret = params.clientSecret; const prompt = params.prompt; + const nativeClientIds = params.nativeClientIds; const enabled = params.enabled; + const nativeEnabled = params.nativeEnabled; const apiPath = '/project/oauth2/google'; const apiPayload: Payload = {}; if (typeof clientId !== 'undefined') { @@ -3058,9 +3110,15 @@ export class Project { if (typeof prompt !== 'undefined') { apiPayload['prompt'] = prompt; } + if (typeof nativeClientIds !== 'undefined') { + apiPayload['nativeClientIds'] = nativeClientIds; + } if (typeof enabled !== 'undefined') { apiPayload['enabled'] = enabled; } + if (typeof nativeEnabled !== 'undefined') { + apiPayload['nativeEnabled'] = nativeEnabled; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -3114,7 +3172,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -3157,6 +3215,91 @@ export class Project { return this.client.call('patch', uri, apiHeaders, apiPayload); } + /** + * Update the project OAuth2 Kakao configuration. + * + * @param {string} params.clientId - 'REST API key' of Kakao OAuth2 app. For example: 839ff5000000000000000000013206de + * @param {string} params.clientSecret - 'Client Secret' of Kakao OAuth2 app. For example: jLNVOK00000000000000000000yJebea. Generate it under Kakao Login > Security and set its status to enabled + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Kakao(params?: { + clientId?: string; + clientSecret?: string; + enabled?: boolean; + }): Promise; + /** + * Update the project OAuth2 Kakao configuration. + * + * @param {string} clientId - 'REST API key' of Kakao OAuth2 app. For example: 839ff5000000000000000000013206de + * @param {string} clientSecret - 'Client Secret' of Kakao OAuth2 app. For example: jLNVOK00000000000000000000yJebea. Generate it under Kakao Login > Security and set its status to enabled + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Kakao( + clientId?: string, + clientSecret?: string, + enabled?: boolean, + ): Promise; + updateOAuth2Kakao( + paramsOrFirst?: + | { clientId?: string; clientSecret?: string; enabled?: boolean } + | string, + ...rest: [string?, boolean?] + ): Promise { + let params: { + clientId?: string; + clientSecret?: string; + enabled?: boolean; + }; + + if ( + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { + params = (paramsOrFirst || {}) as { + clientId?: string; + clientSecret?: string; + enabled?: boolean; + }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean, + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + const apiPath = '/project/oauth2/kakao'; + const apiPayload: Payload = {}; + if (typeof clientId !== 'undefined') { + apiPayload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + apiPayload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + apiPayload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('patch', uri, apiHeaders, apiPayload); + } + /** * Update the project OAuth2 Keycloak configuration. * @@ -3215,7 +3358,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -3312,7 +3455,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -3401,7 +3544,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -3496,7 +3639,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -3591,7 +3734,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -3725,7 +3868,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -3862,7 +4005,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -3959,7 +4102,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -4044,7 +4187,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -4129,7 +4272,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -4214,7 +4357,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -4303,7 +4446,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -4388,7 +4531,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -4473,7 +4616,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -4558,7 +4701,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -4601,6 +4744,91 @@ export class Project { return this.client.call('patch', uri, apiHeaders, apiPayload); } + /** + * Update the project OAuth2 TikTok configuration. + * + * @param {string} params.clientId - 'Client key' of TikTok OAuth2 app. For example: awz000000000tyw0 + * @param {string} params.clientSecret - 'Client secret' of TikTok OAuth2 app. For example: 6wXewM00000000000000000000yXnite + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2TikTok(params?: { + clientId?: string; + clientSecret?: string; + enabled?: boolean; + }): Promise; + /** + * Update the project OAuth2 TikTok configuration. + * + * @param {string} clientId - 'Client key' of TikTok OAuth2 app. For example: awz000000000tyw0 + * @param {string} clientSecret - 'Client secret' of TikTok OAuth2 app. For example: 6wXewM00000000000000000000yXnite + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2TikTok( + clientId?: string, + clientSecret?: string, + enabled?: boolean, + ): Promise; + updateOAuth2TikTok( + paramsOrFirst?: + | { clientId?: string; clientSecret?: string; enabled?: boolean } + | string, + ...rest: [string?, boolean?] + ): Promise { + let params: { + clientId?: string; + clientSecret?: string; + enabled?: boolean; + }; + + if ( + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { + params = (paramsOrFirst || {}) as { + clientId?: string; + clientSecret?: string; + enabled?: boolean; + }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean, + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + const apiPath = '/project/oauth2/tiktok'; + const apiPayload: Payload = {}; + if (typeof clientId !== 'undefined') { + apiPayload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + apiPayload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + apiPayload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('patch', uri, apiHeaders, apiPayload); + } + /** * Update the project OAuth2 Tradeshift configuration. * @@ -4647,7 +4875,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -4736,7 +4964,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -4821,7 +5049,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -4906,7 +5134,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -4991,7 +5219,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -5076,7 +5304,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -5161,7 +5389,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -5246,7 +5474,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -5331,7 +5559,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -5379,7 +5607,7 @@ export class Project { * * @param {ProjectOAuthProviderId} params.providerId - OAuth2 provider key. For example: github, google, apple. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ getOAuth2Provider(params: { providerId: ProjectOAuthProviderId; @@ -5427,13 +5655,15 @@ export class Project { | Models.OAuth2Okta | Models.OAuth2Kick | Models.OAuth2Microsoft + | Models.OAuth2TikTok + | Models.OAuth2Kakao >; /** * Get a single OAuth2 provider configuration. Credential fields (client secret, p8 file, key/team IDs) are write-only and always returned empty. * * @param {ProjectOAuthProviderId} providerId - OAuth2 provider key. For example: github, google, apple. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getOAuth2Provider( @@ -5482,6 +5712,8 @@ export class Project { | Models.OAuth2Okta | Models.OAuth2Kick | Models.OAuth2Microsoft + | Models.OAuth2TikTok + | Models.OAuth2Kakao >; getOAuth2Provider( paramsOrFirst: @@ -5530,6 +5762,8 @@ export class Project { | Models.OAuth2Okta | Models.OAuth2Kick | Models.OAuth2Microsoft + | Models.OAuth2TikTok + | Models.OAuth2Kakao > { let params: { providerId: ProjectOAuthProviderId }; @@ -5601,7 +5835,7 @@ export class Project { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -5788,7 +6022,7 @@ export class Project { const platformId = params.platformId; const name = params.name; const applicationId = params.applicationId; - if (typeof platformId === 'undefined') { + if (typeof platformId === 'undefined' || platformId === '') { throw new AppwriteException( 'Missing required parameter: "platformId"', ); @@ -5982,7 +6216,7 @@ export class Project { const platformId = params.platformId; const name = params.name; const bundleIdentifier = params.bundleIdentifier; - if (typeof platformId === 'undefined') { + if (typeof platformId === 'undefined' || platformId === '') { throw new AppwriteException( 'Missing required parameter: "platformId"', ); @@ -6166,7 +6400,7 @@ export class Project { const platformId = params.platformId; const name = params.name; const packageName = params.packageName; - if (typeof platformId === 'undefined') { + if (typeof platformId === 'undefined' || platformId === '') { throw new AppwriteException( 'Missing required parameter: "platformId"', ); @@ -6350,7 +6584,7 @@ export class Project { const platformId = params.platformId; const name = params.name; const hostname = params.hostname; - if (typeof platformId === 'undefined') { + if (typeof platformId === 'undefined' || platformId === '') { throw new AppwriteException( 'Missing required parameter: "platformId"', ); @@ -6552,7 +6786,7 @@ export class Project { const platformId = params.platformId; const name = params.name; const packageIdentifierName = params.packageIdentifierName; - if (typeof platformId === 'undefined') { + if (typeof platformId === 'undefined' || platformId === '') { throw new AppwriteException( 'Missing required parameter: "platformId"', ); @@ -6644,7 +6878,7 @@ export class Project { } const platformId = params.platformId; - if (typeof platformId === 'undefined') { + if (typeof platformId === 'undefined' || platformId === '') { throw new AppwriteException( 'Missing required parameter: "platformId"', ); @@ -6699,7 +6933,7 @@ export class Project { } const platformId = params.platformId; - if (typeof platformId === 'undefined') { + if (typeof platformId === 'undefined' || platformId === '') { throw new AppwriteException( 'Missing required parameter: "platformId"', ); @@ -6714,6 +6948,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -6751,7 +6986,7 @@ export class Project { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -7083,7 +7318,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -7196,7 +7431,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -7421,6 +7656,87 @@ export class Project { return this.client.call('patch', uri, apiHeaders, apiPayload); } + /** + * Updating this policy allows you to control if passwords are checked against the Have I Been Pwned breach database. When enabled, every password a user signs up, signs in or resets with is checked and the result is recorded on the user as `passwordPwned`. On its own the policy only records. Enable `users` to reject a breached password when a user signs up or sets a new password, and `sessions` to refuse a sign-in with a breached password until it is reset. Only the first five characters of the password hash are ever shared with the service. Options left out keep their current value. + * + * @param {boolean} params.enabled - Toggle password pwned policy. Set to true to check passwords against known data breaches and record the result on the user, or false to never check. Default is true. On its own this only records; use `users` and `sessions` to block. When changing this policy, existing passwords remain valid. + * @param {boolean} params.sessions - Whether a sign-in with a breached password is refused until the password is reset. Default is false, which allows the sign-in and only records the result. + * @param {boolean} params.users - Whether a breached password is rejected when a user signs up or sets a new password. Default is false, which allows the password and only records the result. + * @throws {AppwriteException} + * @returns {Promise} + */ + updatePasswordPwnedPolicy(params?: { + enabled?: boolean; + sessions?: boolean; + users?: boolean; + }): Promise; + /** + * Updating this policy allows you to control if passwords are checked against the Have I Been Pwned breach database. When enabled, every password a user signs up, signs in or resets with is checked and the result is recorded on the user as `passwordPwned`. On its own the policy only records. Enable `users` to reject a breached password when a user signs up or sets a new password, and `sessions` to refuse a sign-in with a breached password until it is reset. Only the first five characters of the password hash are ever shared with the service. Options left out keep their current value. + * + * @param {boolean} enabled - Toggle password pwned policy. Set to true to check passwords against known data breaches and record the result on the user, or false to never check. Default is true. On its own this only records; use `users` and `sessions` to block. When changing this policy, existing passwords remain valid. + * @param {boolean} sessions - Whether a sign-in with a breached password is refused until the password is reset. Default is false, which allows the sign-in and only records the result. + * @param {boolean} users - Whether a breached password is rejected when a user signs up or sets a new password. Default is false, which allows the password and only records the result. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updatePasswordPwnedPolicy( + enabled?: boolean, + sessions?: boolean, + users?: boolean, + ): Promise; + updatePasswordPwnedPolicy( + paramsOrFirst?: + | { enabled?: boolean; sessions?: boolean; users?: boolean } + | boolean, + ...rest: [boolean?, boolean?] + ): Promise { + let params: { enabled?: boolean; sessions?: boolean; users?: boolean }; + + if ( + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { + params = (paramsOrFirst || {}) as { + enabled?: boolean; + sessions?: boolean; + users?: boolean; + }; + } else { + params = { + enabled: paramsOrFirst as boolean, + sessions: rest[0] as boolean, + users: rest[1] as boolean, + }; + } + + const enabled = params.enabled; + const sessions = params.sessions; + const users = params.users; + const apiPath = '/project/policies/password-pwned'; + const apiPayload: Payload = {}; + if (typeof enabled !== 'undefined') { + apiPayload['enabled'] = enabled; + } + if (typeof sessions !== 'undefined') { + apiPayload['sessions'] = sessions; + } + if (typeof users !== 'undefined') { + apiPayload['users'] = users; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('patch', uri, apiHeaders, apiPayload); + } + /** * Update the password strength requirements for users in the project. * @@ -7479,7 +7795,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -7821,9 +8137,9 @@ export class Project { /** * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy. * - * @param {ProjectPolicyId} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, mfa-factors, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email. + * @param {ProjectPolicyId} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, password-pwned, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, mfa-factors, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ getPolicy(params: { policyId: ProjectPolicyId; @@ -7832,6 +8148,7 @@ export class Project { | Models.PolicyPasswordHistory | Models.PolicyPasswordStrength | Models.PolicyPasswordPersonalData + | Models.PolicyPasswordPwned | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation @@ -7847,9 +8164,9 @@ export class Project { /** * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy. * - * @param {ProjectPolicyId} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, mfa-factors, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email. + * @param {ProjectPolicyId} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, password-pwned, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, mfa-factors, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getPolicy( @@ -7859,6 +8176,7 @@ export class Project { | Models.PolicyPasswordHistory | Models.PolicyPasswordStrength | Models.PolicyPasswordPersonalData + | Models.PolicyPasswordPwned | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation @@ -7878,6 +8196,7 @@ export class Project { | Models.PolicyPasswordHistory | Models.PolicyPasswordStrength | Models.PolicyPasswordPersonalData + | Models.PolicyPasswordPwned | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation @@ -8186,7 +8505,7 @@ export class Project { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -8319,6 +8638,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('post', uri, apiHeaders, apiPayload); @@ -8356,7 +8676,7 @@ export class Project { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -8395,7 +8715,7 @@ export class Project { /** * Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates. * - * @param {ProjectEmailTemplateId} params.templateId - Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession + * @param {ProjectEmailTemplateId} params.templateId - Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession, otpVerification, otpRecovery * @param {ProjectEmailTemplateLocale} params.locale - Custom email template locale. If left empty, the fallback locale (en) will be used. * @param {string} params.subject - Subject of the email template. Can be up to 255 characters. * @param {string} params.message - Plain or HTML body of the email template message. Can be up to 10MB of content. @@ -8419,7 +8739,7 @@ export class Project { /** * Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates. * - * @param {ProjectEmailTemplateId} templateId - Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession + * @param {ProjectEmailTemplateId} templateId - Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession, otpVerification, otpRecovery * @param {ProjectEmailTemplateLocale} locale - Custom email template locale. If left empty, the fallback locale (en) will be used. * @param {string} subject - Subject of the email template. Can be up to 255 characters. * @param {string} message - Plain or HTML body of the email template message. Can be up to 10MB of content. @@ -8564,7 +8884,7 @@ export class Project { /** * Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. * - * @param {ProjectEmailTemplateId} params.templateId - Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession + * @param {ProjectEmailTemplateId} params.templateId - Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession, otpVerification, otpRecovery * @param {ProjectEmailTemplateLocale} params.locale - Custom email template locale. If left empty, the fallback locale (en) will be used. * @throws {AppwriteException} * @returns {Promise} @@ -8576,7 +8896,7 @@ export class Project { /** * Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. * - * @param {ProjectEmailTemplateId} templateId - Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession + * @param {ProjectEmailTemplateId} templateId - Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession, otpVerification, otpRecovery * @param {ProjectEmailTemplateLocale} locale - Custom email template locale. If left empty, the fallback locale (en) will be used. * @throws {AppwriteException} * @returns {Promise} @@ -8674,7 +8994,7 @@ export class Project { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -8856,7 +9176,7 @@ export class Project { } const variableId = params.variableId; - if (typeof variableId === 'undefined') { + if (typeof variableId === 'undefined' || variableId === '') { throw new AppwriteException( 'Missing required parameter: "variableId"', ); @@ -8951,7 +9271,7 @@ export class Project { const key = params.key; const value = params.value; const secret = params.secret; - if (typeof variableId === 'undefined') { + if (typeof variableId === 'undefined' || variableId === '') { throw new AppwriteException( 'Missing required parameter: "variableId"', ); @@ -9016,7 +9336,7 @@ export class Project { } const variableId = params.variableId; - if (typeof variableId === 'undefined') { + if (typeof variableId === 'undefined' || variableId === '') { throw new AppwriteException( 'Missing required parameter: "variableId"', ); @@ -9031,6 +9351,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); diff --git a/src/services/proxy.ts b/src/services/proxy.ts index 1f4d674e..1bcf88cb 100644 --- a/src/services/proxy.ts +++ b/src/services/proxy.ts @@ -137,7 +137,7 @@ export class Proxy { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -583,7 +583,7 @@ export class Proxy { } const ruleId = params.ruleId; - if (typeof ruleId === 'undefined') { + if (typeof ruleId === 'undefined' || ruleId === '') { throw new AppwriteException('Missing required parameter: "ruleId"'); } const apiPath = '/proxy/rules/{ruleId}'.replace( @@ -634,7 +634,7 @@ export class Proxy { } const ruleId = params.ruleId; - if (typeof ruleId === 'undefined') { + if (typeof ruleId === 'undefined' || ruleId === '') { throw new AppwriteException('Missing required parameter: "ruleId"'); } const apiPath = '/proxy/rules/{ruleId}'.replace( @@ -647,6 +647,7 @@ export class Proxy { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -687,7 +688,7 @@ export class Proxy { } const ruleId = params.ruleId; - if (typeof ruleId === 'undefined') { + if (typeof ruleId === 'undefined' || ruleId === '') { throw new AppwriteException('Missing required parameter: "ruleId"'); } const apiPath = '/proxy/rules/{ruleId}/status'.replace( diff --git a/src/services/sites.ts b/src/services/sites.ts index d6845214..35666297 100644 --- a/src/services/sites.ts +++ b/src/services/sites.ts @@ -58,7 +58,7 @@ export class Sites { let params: { queries?: string[]; search?: string; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -524,7 +524,7 @@ export class Sites { let params: { type?: string }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -585,7 +585,7 @@ export class Sites { } const siteId = params.siteId; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } const apiPath = '/sites/{siteId}'.replace( @@ -882,7 +882,7 @@ export class Sites { const runtimeSpecification = params.runtimeSpecification; const deploymentRetention = params.deploymentRetention; const scopes = params.scopes; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } if (typeof name === 'undefined') { @@ -1011,7 +1011,7 @@ export class Sites { } const siteId = params.siteId; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } const apiPath = '/sites/{siteId}'.replace( @@ -1024,6 +1024,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -1078,7 +1079,7 @@ export class Sites { const siteId = params.siteId; const deploymentId = params.deploymentId; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } if (typeof deploymentId === 'undefined') { @@ -1180,7 +1181,7 @@ export class Sites { const queries = params.queries; const search = params.search; const total = params.total; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } const apiPath = '/sites/{siteId}/deployments'.replace( @@ -1315,7 +1316,7 @@ export class Sites { const buildCommand = params.buildCommand; const outputDirectory = params.outputDirectory; const activate = params.activate; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } if (typeof code === 'undefined') { @@ -1407,7 +1408,7 @@ export class Sites { const siteId = params.siteId; const deploymentId = params.deploymentId; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } if (typeof deploymentId === 'undefined') { @@ -1547,7 +1548,7 @@ export class Sites { const type = params.type; const reference = params.reference; const activate = params.activate; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } if (typeof repository === 'undefined') { @@ -1684,7 +1685,7 @@ export class Sites { const type = params.type; const reference = params.reference; const activate = params.activate; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } if (typeof type === 'undefined') { @@ -1769,10 +1770,10 @@ export class Sites { const siteId = params.siteId; const deploymentId = params.deploymentId; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } - if (typeof deploymentId === 'undefined') { + if (typeof deploymentId === 'undefined' || deploymentId === '') { throw new AppwriteException( 'Missing required parameter: "deploymentId"', ); @@ -1840,10 +1841,10 @@ export class Sites { const siteId = params.siteId; const deploymentId = params.deploymentId; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } - if (typeof deploymentId === 'undefined') { + if (typeof deploymentId === 'undefined' || deploymentId === '') { throw new AppwriteException( 'Missing required parameter: "deploymentId"', ); @@ -1860,6 +1861,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -1940,10 +1942,10 @@ export class Sites { const deploymentId = params.deploymentId; const type = params.type; const token = params.token; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } - if (typeof deploymentId === 'undefined') { + if (typeof deploymentId === 'undefined' || deploymentId === '') { throw new AppwriteException( 'Missing required parameter: "deploymentId"', ); @@ -2026,10 +2028,10 @@ export class Sites { const siteId = params.siteId; const deploymentId = params.deploymentId; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } - if (typeof deploymentId === 'undefined') { + if (typeof deploymentId === 'undefined' || deploymentId === '') { throw new AppwriteException( 'Missing required parameter: "deploymentId"', ); @@ -2109,7 +2111,7 @@ export class Sites { const siteId = params.siteId; const queries = params.queries; const total = params.total; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } const apiPath = '/sites/{siteId}/logs'.replace( @@ -2176,10 +2178,10 @@ export class Sites { const siteId = params.siteId; const logId = params.logId; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } - if (typeof logId === 'undefined') { + if (typeof logId === 'undefined' || logId === '') { throw new AppwriteException('Missing required parameter: "logId"'); } const apiPath = '/sites/{siteId}/logs/{logId}' @@ -2236,10 +2238,10 @@ export class Sites { const siteId = params.siteId; const logId = params.logId; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } - if (typeof logId === 'undefined') { + if (typeof logId === 'undefined' || logId === '') { throw new AppwriteException('Missing required parameter: "logId"'); } const apiPath = '/sites/{siteId}/logs/{logId}' @@ -2314,7 +2316,7 @@ export class Sites { const siteId = params.siteId; const queries = params.queries; const total = params.total; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } const apiPath = '/sites/{siteId}/variables'.replace( @@ -2422,7 +2424,7 @@ export class Sites { const key = params.key; const value = params.value; const secret = params.secret; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } if (typeof variableId === 'undefined') { @@ -2510,10 +2512,10 @@ export class Sites { const siteId = params.siteId; const variableId = params.variableId; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } - if (typeof variableId === 'undefined') { + if (typeof variableId === 'undefined' || variableId === '') { throw new AppwriteException( 'Missing required parameter: "variableId"', ); @@ -2616,10 +2618,10 @@ export class Sites { const key = params.key; const value = params.value; const secret = params.secret; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } - if (typeof variableId === 'undefined') { + if (typeof variableId === 'undefined' || variableId === '') { throw new AppwriteException( 'Missing required parameter: "variableId"', ); @@ -2691,10 +2693,10 @@ export class Sites { const siteId = params.siteId; const variableId = params.variableId; - if (typeof siteId === 'undefined') { + if (typeof siteId === 'undefined' || siteId === '') { throw new AppwriteException('Missing required parameter: "siteId"'); } - if (typeof variableId === 'undefined') { + if (typeof variableId === 'undefined' || variableId === '') { throw new AppwriteException( 'Missing required parameter: "variableId"', ); @@ -2708,6 +2710,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); diff --git a/src/services/storage.ts b/src/services/storage.ts index 6d1d65f2..eee28df1 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -54,7 +54,7 @@ export class Storage { let params: { queries?: string[]; search?: string; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -334,7 +334,7 @@ export class Storage { } const bucketId = params.bucketId; - if (typeof bucketId === 'undefined') { + if (typeof bucketId === 'undefined' || bucketId === '') { throw new AppwriteException( 'Missing required parameter: "bucketId"', ); @@ -503,7 +503,7 @@ export class Storage { const encryption = params.encryption; const antivirus = params.antivirus; const transformations = params.transformations; - if (typeof bucketId === 'undefined') { + if (typeof bucketId === 'undefined' || bucketId === '') { throw new AppwriteException( 'Missing required parameter: "bucketId"', ); @@ -590,7 +590,7 @@ export class Storage { } const bucketId = params.bucketId; - if (typeof bucketId === 'undefined') { + if (typeof bucketId === 'undefined' || bucketId === '') { throw new AppwriteException( 'Missing required parameter: "bucketId"', ); @@ -605,6 +605,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -685,7 +686,7 @@ export class Storage { const queries = params.queries; const search = params.search; const total = params.total; - if (typeof bucketId === 'undefined') { + if (typeof bucketId === 'undefined' || bucketId === '') { throw new AppwriteException( 'Missing required parameter: "bucketId"', ); @@ -826,7 +827,7 @@ export class Storage { const file = params.file; const permissions = params.permissions; const folder = params.folder; - if (typeof bucketId === 'undefined') { + if (typeof bucketId === 'undefined' || bucketId === '') { throw new AppwriteException( 'Missing required parameter: "bucketId"', ); @@ -914,12 +915,12 @@ export class Storage { const bucketId = params.bucketId; const fileId = params.fileId; - if (typeof bucketId === 'undefined') { + if (typeof bucketId === 'undefined' || bucketId === '') { throw new AppwriteException( 'Missing required parameter: "bucketId"', ); } - if (typeof fileId === 'undefined') { + if (typeof fileId === 'undefined' || fileId === '') { throw new AppwriteException('Missing required parameter: "fileId"'); } const apiPath = '/storage/buckets/{bucketId}/files/{fileId}' @@ -1011,12 +1012,12 @@ export class Storage { const fileId = params.fileId; const name = params.name; const permissions = params.permissions; - if (typeof bucketId === 'undefined') { + if (typeof bucketId === 'undefined' || bucketId === '') { throw new AppwriteException( 'Missing required parameter: "bucketId"', ); } - if (typeof fileId === 'undefined') { + if (typeof fileId === 'undefined' || fileId === '') { throw new AppwriteException('Missing required parameter: "fileId"'); } const apiPath = '/storage/buckets/{bucketId}/files/{fileId}' @@ -1083,12 +1084,12 @@ export class Storage { const bucketId = params.bucketId; const fileId = params.fileId; - if (typeof bucketId === 'undefined') { + if (typeof bucketId === 'undefined' || bucketId === '') { throw new AppwriteException( 'Missing required parameter: "bucketId"', ); } - if (typeof fileId === 'undefined') { + if (typeof fileId === 'undefined' || fileId === '') { throw new AppwriteException('Missing required parameter: "fileId"'); } const apiPath = '/storage/buckets/{bucketId}/files/{fileId}' @@ -1100,6 +1101,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -1162,12 +1164,12 @@ export class Storage { const bucketId = params.bucketId; const fileId = params.fileId; const token = params.token; - if (typeof bucketId === 'undefined') { + if (typeof bucketId === 'undefined' || bucketId === '') { throw new AppwriteException( 'Missing required parameter: "bucketId"', ); } - if (typeof fileId === 'undefined') { + if (typeof fileId === 'undefined' || fileId === '') { throw new AppwriteException('Missing required parameter: "fileId"'); } const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download' @@ -1200,7 +1202,7 @@ export class Storage { * @param {string} params.fileId - File ID * @param {number} params.width - Resize preview image width, Pass an integer between 0 to 4000. * @param {number} params.height - Resize preview image height, Pass an integer between 0 to 4000. - * @param {ImageGravity} params.gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right + * @param {ImageGravity} params.gravity - Image crop gravity. Can be one of auto,center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right * @param {number} params.quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @param {number} params.borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. * @param {string} params.borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix. @@ -1236,7 +1238,7 @@ export class Storage { * @param {string} fileId - File ID * @param {number} width - Resize preview image width, Pass an integer between 0 to 4000. * @param {number} height - Resize preview image height, Pass an integer between 0 to 4000. - * @param {ImageGravity} gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right + * @param {ImageGravity} gravity - Image crop gravity. Can be one of auto,center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right * @param {number} quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @param {number} borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. * @param {string} borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix. @@ -1372,12 +1374,12 @@ export class Storage { const background = params.background; const output = params.output; const token = params.token; - if (typeof bucketId === 'undefined') { + if (typeof bucketId === 'undefined' || bucketId === '') { throw new AppwriteException( 'Missing required parameter: "bucketId"', ); } - if (typeof fileId === 'undefined') { + if (typeof fileId === 'undefined' || fileId === '') { throw new AppwriteException('Missing required parameter: "fileId"'); } const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview' @@ -1493,12 +1495,12 @@ export class Storage { const bucketId = params.bucketId; const fileId = params.fileId; const token = params.token; - if (typeof bucketId === 'undefined') { + if (typeof bucketId === 'undefined' || bucketId === '') { throw new AppwriteException( 'Missing required parameter: "bucketId"', ); } - if (typeof fileId === 'undefined') { + if (typeof fileId === 'undefined' || fileId === '') { throw new AppwriteException('Missing required parameter: "fileId"'); } const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view' diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index b57d0960..8e0bfd2a 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -49,7 +49,7 @@ export class TablesDB { let params: { queries?: string[]; search?: string; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -226,7 +226,7 @@ export class TablesDB { } /** - * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, pricing, and whether it is enabled for the organization. + * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, its own prices and overage rates, and whether it is enabled for the organization. * * @throws {AppwriteException} * @returns {Promise} @@ -269,7 +269,7 @@ export class TablesDB { let params: { queries?: string[] }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -320,7 +320,7 @@ export class TablesDB { let params: { ttl?: number }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -386,7 +386,7 @@ export class TablesDB { } const transactionId = params.transactionId; - if (typeof transactionId === 'undefined') { + if (typeof transactionId === 'undefined' || transactionId === '') { throw new AppwriteException( 'Missing required parameter: "transactionId"', ); @@ -468,7 +468,7 @@ export class TablesDB { const transactionId = params.transactionId; const commit = params.commit; const rollback = params.rollback; - if (typeof transactionId === 'undefined') { + if (typeof transactionId === 'undefined' || transactionId === '') { throw new AppwriteException( 'Missing required parameter: "transactionId"', ); @@ -530,7 +530,7 @@ export class TablesDB { } const transactionId = params.transactionId; - if (typeof transactionId === 'undefined') { + if (typeof transactionId === 'undefined' || transactionId === '') { throw new AppwriteException( 'Missing required parameter: "transactionId"', ); @@ -545,6 +545,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -600,7 +601,7 @@ export class TablesDB { const transactionId = params.transactionId; const operations = params.operations; - if (typeof transactionId === 'undefined') { + if (typeof transactionId === 'undefined' || transactionId === '') { throw new AppwriteException( 'Missing required parameter: "transactionId"', ); @@ -660,7 +661,7 @@ export class TablesDB { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -773,7 +774,7 @@ export class TablesDB { const specification = params.specification; const replicas = params.replicas; const syncMode = params.syncMode; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -842,7 +843,7 @@ export class TablesDB { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -857,6 +858,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -912,7 +914,7 @@ export class TablesDB { const databaseId = params.databaseId; const targetReplicaId = params.targetReplicaId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -973,7 +975,7 @@ export class TablesDB { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1059,7 +1061,7 @@ export class TablesDB { const databaseId = params.databaseId; const specification = params.specification; const autoCutover = params.autoCutover; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1140,12 +1142,12 @@ export class TablesDB { const databaseId = params.databaseId; const migrationId = params.migrationId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof migrationId === 'undefined') { + if (typeof migrationId === 'undefined' || migrationId === '') { throw new AppwriteException( 'Missing required parameter: "migrationId"', ); @@ -1210,12 +1212,12 @@ export class TablesDB { const databaseId = params.databaseId; const migrationId = params.migrationId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof migrationId === 'undefined') { + if (typeof migrationId === 'undefined' || migrationId === '') { throw new AppwriteException( 'Missing required parameter: "migrationId"', ); @@ -1284,12 +1286,12 @@ export class TablesDB { const databaseId = params.databaseId; const migrationId = params.migrationId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof migrationId === 'undefined') { + if (typeof migrationId === 'undefined' || migrationId === '') { throw new AppwriteException( 'Missing required parameter: "migrationId"', ); @@ -1388,7 +1390,7 @@ export class TablesDB { const status = params.status; const limit = params.limit; const offset = params.offset; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1454,7 +1456,7 @@ export class TablesDB { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1509,7 +1511,7 @@ export class TablesDB { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1604,7 +1606,7 @@ export class TablesDB { const queries = params.queries; const search = params.search; const total = params.total; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1752,7 +1754,7 @@ export class TablesDB { const enabled = params.enabled; const columns = params.columns; const indexes = params.indexes; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1848,12 +1850,12 @@ export class TablesDB { const databaseId = params.databaseId; const tableId = params.tableId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -1974,12 +1976,12 @@ export class TablesDB { const rowSecurity = params.rowSecurity; const enabled = params.enabled; const purge = params.purge; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -2057,12 +2059,12 @@ export class TablesDB { const databaseId = params.databaseId; const tableId = params.tableId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -2076,6 +2078,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -2156,12 +2159,12 @@ export class TablesDB { const tableId = params.tableId; const queries = params.queries; const total = params.total; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -2307,12 +2310,12 @@ export class TablesDB { const max = params.max; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -2479,17 +2482,17 @@ export class TablesDB { const min = params.min; const max = params.max; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -2629,12 +2632,12 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -2768,17 +2771,17 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -2910,12 +2913,12 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -3049,17 +3052,17 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -3193,12 +3196,12 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -3333,17 +3336,17 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -3484,12 +3487,12 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -3641,17 +3644,17 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof elements === 'undefined') { @@ -3819,12 +3822,12 @@ export class TablesDB { const max = params.max; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -3991,17 +3994,17 @@ export class TablesDB { const min = params.min; const max = params.max; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -4167,12 +4170,12 @@ export class TablesDB { const max = params.max; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -4340,17 +4343,17 @@ export class TablesDB { const min = params.min; const max = params.max; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -4490,12 +4493,12 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -4630,17 +4633,17 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -4763,12 +4766,12 @@ export class TablesDB { const key = params.key; const required = params.required; const xdefault = params.xdefault; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -4898,17 +4901,17 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -5046,12 +5049,12 @@ export class TablesDB { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -5190,17 +5193,17 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -5343,12 +5346,12 @@ export class TablesDB { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -5487,17 +5490,17 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -5620,12 +5623,12 @@ export class TablesDB { const key = params.key; const required = params.required; const xdefault = params.xdefault; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -5755,17 +5758,17 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -5883,12 +5886,12 @@ export class TablesDB { const key = params.key; const required = params.required; const xdefault = params.xdefault; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -6019,17 +6022,17 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -6184,12 +6187,12 @@ export class TablesDB { const key = params.key; const twoWayKey = params.twoWayKey; const onDelete = params.onDelete; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -6236,6 +6239,128 @@ export class TablesDB { return this.client.call('post', uri, apiHeaders, apiPayload); } + /** + * Update relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). + * + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.tableId - Table ID. + * @param {string} params.key - Column Key. + * @param {RelationMutate} params.onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. + * @param {string} params.newKey - New Column Key. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateRelationshipColumn(params: { + databaseId: string; + tableId: string; + key: string; + onDelete?: RelationMutate; + newKey?: string; + }): Promise; + /** + * Update relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). + * + * + * @param {string} databaseId - Database ID. + * @param {string} tableId - Table ID. + * @param {string} key - Column Key. + * @param {RelationMutate} onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. + * @param {string} newKey - New Column Key. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateRelationshipColumn( + databaseId: string, + tableId: string, + key: string, + onDelete?: RelationMutate, + newKey?: string, + ): Promise; + updateRelationshipColumn( + paramsOrFirst: + | { + databaseId: string; + tableId: string; + key: string; + onDelete?: RelationMutate; + newKey?: string; + } + | string, + ...rest: [string?, string?, RelationMutate?, string?] + ): Promise { + let params: { + databaseId: string; + tableId: string; + key: string; + onDelete?: RelationMutate; + newKey?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + tableId: string; + key: string; + onDelete?: RelationMutate; + newKey?: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + tableId: rest[0] as string, + key: rest[1] as string, + onDelete: rest[2] as RelationMutate, + newKey: rest[3] as string, + }; + } + + const databaseId = params.databaseId; + const tableId = params.tableId; + const key = params.key; + const onDelete = params.onDelete; + const newKey = params.newKey; + if (typeof databaseId === 'undefined' || databaseId === '') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + if (typeof tableId === 'undefined' || tableId === '') { + throw new AppwriteException( + 'Missing required parameter: "tableId"', + ); + } + if (typeof key === 'undefined' || key === '') { + throw new AppwriteException('Missing required parameter: "key"'); + } + const apiPath = + '/tablesdb/{databaseId}/tables/{tableId}/columns/relationship/{key}' + .replace('{databaseId}', encodeURIComponent(String(databaseId))) + .replace('{tableId}', encodeURIComponent(String(tableId))) + .replace('{key}', encodeURIComponent(String(key))); + const apiPayload: Payload = {}; + if (typeof onDelete !== 'undefined') { + apiPayload['onDelete'] = onDelete; + } + if (typeof newKey !== 'undefined') { + apiPayload['newKey'] = newKey; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }; + + return this.client.call('patch', uri, apiHeaders, apiPayload); + } + /** * Create a string column. * @@ -6358,12 +6483,12 @@ export class TablesDB { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -6517,17 +6642,17 @@ export class TablesDB { const xdefault = params.xdefault; const size = params.size; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -6673,12 +6798,12 @@ export class TablesDB { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -6816,17 +6941,17 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -6960,12 +7085,12 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const array = params.array; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -7100,17 +7225,17 @@ export class TablesDB { const required = params.required; const xdefault = params.xdefault; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -7270,12 +7395,12 @@ export class TablesDB { const xdefault = params.xdefault; const array = params.array; const encrypt = params.encrypt; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -7429,17 +7554,17 @@ export class TablesDB { const xdefault = params.xdefault; const size = params.size; const newKey = params.newKey; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } if (typeof required === 'undefined') { @@ -7488,7 +7613,7 @@ export class TablesDB { * @param {string} params.tableId - Table ID. * @param {string} params.key - Column Key. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ getColumn(params: { databaseId: string; @@ -7496,6 +7621,7 @@ export class TablesDB { key: string; }): Promise< | Models.ColumnBoolean + | Models.ColumnBigint | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail @@ -7504,6 +7630,13 @@ export class TablesDB { | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship + | Models.ColumnPoint + | Models.ColumnLine + | Models.ColumnPolygon + | Models.ColumnVarchar + | Models.ColumnText + | Models.ColumnMediumtext + | Models.ColumnLongtext | Models.ColumnString >; /** @@ -7513,7 +7646,7 @@ export class TablesDB { * @param {string} tableId - Table ID. * @param {string} key - Column Key. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getColumn( @@ -7522,6 +7655,7 @@ export class TablesDB { key: string, ): Promise< | Models.ColumnBoolean + | Models.ColumnBigint | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail @@ -7530,6 +7664,13 @@ export class TablesDB { | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship + | Models.ColumnPoint + | Models.ColumnLine + | Models.ColumnPolygon + | Models.ColumnVarchar + | Models.ColumnText + | Models.ColumnMediumtext + | Models.ColumnLongtext | Models.ColumnString >; getColumn( @@ -7538,6 +7679,7 @@ export class TablesDB { ...rest: [string?, string?] ): Promise< | Models.ColumnBoolean + | Models.ColumnBigint | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail @@ -7546,6 +7688,13 @@ export class TablesDB { | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship + | Models.ColumnPoint + | Models.ColumnLine + | Models.ColumnPolygon + | Models.ColumnVarchar + | Models.ColumnText + | Models.ColumnMediumtext + | Models.ColumnLongtext | Models.ColumnString > { let params: { databaseId: string; tableId: string; key: string }; @@ -7571,17 +7720,17 @@ export class TablesDB { const databaseId = params.databaseId; const tableId = params.tableId; const key = params.key; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}' @@ -7652,17 +7801,17 @@ export class TablesDB { const databaseId = params.databaseId; const tableId = params.tableId; const key = params.key; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}' @@ -7672,134 +7821,13 @@ export class TablesDB { const apiPayload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - const apiHeaders: { [header: string]: string } = { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - }; - - return this.client.call('delete', uri, apiHeaders, apiPayload); - } - - /** - * Update relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). - * - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.tableId - Table ID. - * @param {string} params.key - Column Key. - * @param {RelationMutate} params.onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. - * @param {string} params.newKey - New Column Key. - * @throws {AppwriteException} - * @returns {Promise} - */ - updateRelationshipColumn(params: { - databaseId: string; - tableId: string; - key: string; - onDelete?: RelationMutate; - newKey?: string; - }): Promise; - /** - * Update relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). - * - * - * @param {string} databaseId - Database ID. - * @param {string} tableId - Table ID. - * @param {string} key - Column Key. - * @param {RelationMutate} onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. - * @param {string} newKey - New Column Key. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - updateRelationshipColumn( - databaseId: string, - tableId: string, - key: string, - onDelete?: RelationMutate, - newKey?: string, - ): Promise; - updateRelationshipColumn( - paramsOrFirst: - | { - databaseId: string; - tableId: string; - key: string; - onDelete?: RelationMutate; - newKey?: string; - } - | string, - ...rest: [string?, string?, RelationMutate?, string?] - ): Promise { - let params: { - databaseId: string; - tableId: string; - key: string; - onDelete?: RelationMutate; - newKey?: string; - }; - - if ( - paramsOrFirst && - typeof paramsOrFirst === 'object' && - !Array.isArray(paramsOrFirst) - ) { - params = (paramsOrFirst || {}) as { - databaseId: string; - tableId: string; - key: string; - onDelete?: RelationMutate; - newKey?: string; - }; - } else { - params = { - databaseId: paramsOrFirst as string, - tableId: rest[0] as string, - key: rest[1] as string, - onDelete: rest[2] as RelationMutate, - newKey: rest[3] as string, - }; - } - - const databaseId = params.databaseId; - const tableId = params.tableId; - const key = params.key; - const onDelete = params.onDelete; - const newKey = params.newKey; - if (typeof databaseId === 'undefined') { - throw new AppwriteException( - 'Missing required parameter: "databaseId"', - ); - } - if (typeof tableId === 'undefined') { - throw new AppwriteException( - 'Missing required parameter: "tableId"', - ); - } - if (typeof key === 'undefined') { - throw new AppwriteException('Missing required parameter: "key"'); - } - const apiPath = - '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship' - .replace('{databaseId}', encodeURIComponent(String(databaseId))) - .replace('{tableId}', encodeURIComponent(String(tableId))) - .replace('{key}', encodeURIComponent(String(key))); - const apiPayload: Payload = {}; - if (typeof onDelete !== 'undefined') { - apiPayload['onDelete'] = onDelete; - } - if (typeof newKey !== 'undefined') { - apiPayload['newKey'] = newKey; - } - const uri = new URL(this.client.config.endpoint + apiPath); - const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', accept: 'application/json', }; - return this.client.call('patch', uri, apiHeaders, apiPayload); + return this.client.call('delete', uri, apiHeaders, apiPayload); } /** @@ -7877,12 +7905,12 @@ export class TablesDB { const tableId = params.tableId; const queries = params.queries; const total = params.total; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -8018,12 +8046,12 @@ export class TablesDB { const columns = params.columns; const orders = params.orders; const lengths = params.lengths; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -8126,17 +8154,17 @@ export class TablesDB { const databaseId = params.databaseId; const tableId = params.tableId; const key = params.key; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}' @@ -8207,17 +8235,17 @@ export class TablesDB { const databaseId = params.databaseId; const tableId = params.tableId; const key = params.key; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}' @@ -8230,6 +8258,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -8328,12 +8357,12 @@ export class TablesDB { const transactionId = params.transactionId; const total = params.total; const ttl = params.ttl; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -8477,12 +8506,12 @@ export class TablesDB { const data = params.data; const permissions = params.permissions; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -8595,12 +8624,12 @@ export class TablesDB { const tableId = params.tableId; const rows = params.rows; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -8706,12 +8735,12 @@ export class TablesDB { const tableId = params.tableId; const rows = params.rows; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -8824,12 +8853,12 @@ export class TablesDB { const data = params.data; const queries = params.queries; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -8933,12 +8962,12 @@ export class TablesDB { const tableId = params.tableId; const queries = params.queries; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); @@ -9048,17 +9077,17 @@ export class TablesDB { const rowId = params.rowId; const queries = params.queries; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof rowId === 'undefined') { + if (typeof rowId === 'undefined' || rowId === '') { throw new AppwriteException('Missing required parameter: "rowId"'); } const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}' @@ -9198,17 +9227,17 @@ export class TablesDB { const data = params.data; const permissions = params.permissions; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof rowId === 'undefined') { + if (typeof rowId === 'undefined' || rowId === '') { throw new AppwriteException('Missing required parameter: "rowId"'); } const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}' @@ -9352,17 +9381,17 @@ export class TablesDB { const data = params.data; const permissions = params.permissions; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof rowId === 'undefined') { + if (typeof rowId === 'undefined' || rowId === '') { throw new AppwriteException('Missing required parameter: "rowId"'); } const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}' @@ -9465,17 +9494,17 @@ export class TablesDB { const tableId = params.tableId; const rowId = params.rowId; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof rowId === 'undefined') { + if (typeof rowId === 'undefined' || rowId === '') { throw new AppwriteException('Missing required parameter: "rowId"'); } const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}' @@ -9491,6 +9520,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -9598,20 +9628,20 @@ export class TablesDB { const value = params.value; const min = params.min; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof rowId === 'undefined') { + if (typeof rowId === 'undefined' || rowId === '') { throw new AppwriteException('Missing required parameter: "rowId"'); } - if (typeof column === 'undefined') { + if (typeof column === 'undefined' || column === '') { throw new AppwriteException('Missing required parameter: "column"'); } const apiPath = @@ -9743,20 +9773,20 @@ export class TablesDB { const value = params.value; const max = params.max; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof tableId === 'undefined') { + if (typeof tableId === 'undefined' || tableId === '') { throw new AppwriteException( 'Missing required parameter: "tableId"', ); } - if (typeof rowId === 'undefined') { + if (typeof rowId === 'undefined' || rowId === '') { throw new AppwriteException('Missing required parameter: "rowId"'); } - if (typeof column === 'undefined') { + if (typeof column === 'undefined' || column === '') { throw new AppwriteException('Missing required parameter: "column"'); } const apiPath = diff --git a/src/services/teams.ts b/src/services/teams.ts index f2ea276c..1c655f54 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -47,7 +47,7 @@ export class Teams { let params: { queries?: string[]; search?: string; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -215,7 +215,7 @@ export class Teams { } const teamId = params.teamId; - if (typeof teamId === 'undefined') { + if (typeof teamId === 'undefined' || teamId === '') { throw new AppwriteException('Missing required parameter: "teamId"'); } const apiPath = '/teams/{teamId}'.replace( @@ -282,7 +282,7 @@ export class Teams { const teamId = params.teamId; const name = params.name; - if (typeof teamId === 'undefined') { + if (typeof teamId === 'undefined' || teamId === '') { throw new AppwriteException('Missing required parameter: "teamId"'); } if (typeof name === 'undefined') { @@ -340,7 +340,7 @@ export class Teams { } const teamId = params.teamId; - if (typeof teamId === 'undefined') { + if (typeof teamId === 'undefined' || teamId === '') { throw new AppwriteException('Missing required parameter: "teamId"'); } const apiPath = '/teams/{teamId}'.replace( @@ -353,6 +353,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -415,7 +416,7 @@ export class Teams { const teamId = params.teamId; const queries = params.queries; const total = params.total; - if (typeof teamId === 'undefined') { + if (typeof teamId === 'undefined' || teamId === '') { throw new AppwriteException('Missing required parameter: "teamId"'); } const apiPath = '/teams/{teamId}/installations'.replace( @@ -501,7 +502,7 @@ export class Teams { const teamId = params.teamId; const appId = params.appId; const authorizationDetails = params.authorizationDetails; - if (typeof teamId === 'undefined') { + if (typeof teamId === 'undefined' || teamId === '') { throw new AppwriteException('Missing required parameter: "teamId"'); } if (typeof appId === 'undefined') { @@ -578,10 +579,10 @@ export class Teams { const teamId = params.teamId; const installationId = params.installationId; - if (typeof teamId === 'undefined') { + if (typeof teamId === 'undefined' || teamId === '') { throw new AppwriteException('Missing required parameter: "teamId"'); } - if (typeof installationId === 'undefined') { + if (typeof installationId === 'undefined' || installationId === '') { throw new AppwriteException( 'Missing required parameter: "installationId"', ); @@ -669,10 +670,10 @@ export class Teams { const teamId = params.teamId; const installationId = params.installationId; const authorizationDetails = params.authorizationDetails; - if (typeof teamId === 'undefined') { + if (typeof teamId === 'undefined' || teamId === '') { throw new AppwriteException('Missing required parameter: "teamId"'); } - if (typeof installationId === 'undefined') { + if (typeof installationId === 'undefined' || installationId === '') { throw new AppwriteException( 'Missing required parameter: "installationId"', ); @@ -744,10 +745,10 @@ export class Teams { const teamId = params.teamId; const installationId = params.installationId; - if (typeof teamId === 'undefined') { + if (typeof teamId === 'undefined' || teamId === '') { throw new AppwriteException('Missing required parameter: "teamId"'); } - if (typeof installationId === 'undefined') { + if (typeof installationId === 'undefined' || installationId === '') { throw new AppwriteException( 'Missing required parameter: "installationId"', ); @@ -845,7 +846,7 @@ export class Teams { const queries = params.queries; const search = params.search; const total = params.total; - if (typeof teamId === 'undefined') { + if (typeof teamId === 'undefined' || teamId === '') { throw new AppwriteException('Missing required parameter: "teamId"'); } const apiPath = '/teams/{teamId}/memberships'.replace( @@ -988,7 +989,7 @@ export class Teams { const phone = params.phone; const url = params.url; const name = params.name; - if (typeof teamId === 'undefined') { + if (typeof teamId === 'undefined' || teamId === '') { throw new AppwriteException('Missing required parameter: "teamId"'); } if (typeof roles === 'undefined') { @@ -1077,10 +1078,10 @@ export class Teams { const teamId = params.teamId; const membershipId = params.membershipId; - if (typeof teamId === 'undefined') { + if (typeof teamId === 'undefined' || teamId === '') { throw new AppwriteException('Missing required parameter: "teamId"'); } - if (typeof membershipId === 'undefined') { + if (typeof membershipId === 'undefined' || membershipId === '') { throw new AppwriteException( 'Missing required parameter: "membershipId"', ); @@ -1161,10 +1162,10 @@ export class Teams { const teamId = params.teamId; const membershipId = params.membershipId; const roles = params.roles; - if (typeof teamId === 'undefined') { + if (typeof teamId === 'undefined' || teamId === '') { throw new AppwriteException('Missing required parameter: "teamId"'); } - if (typeof membershipId === 'undefined') { + if (typeof membershipId === 'undefined' || membershipId === '') { throw new AppwriteException( 'Missing required parameter: "membershipId"', ); @@ -1239,10 +1240,10 @@ export class Teams { const teamId = params.teamId; const membershipId = params.membershipId; - if (typeof teamId === 'undefined') { + if (typeof teamId === 'undefined' || teamId === '') { throw new AppwriteException('Missing required parameter: "teamId"'); } - if (typeof membershipId === 'undefined') { + if (typeof membershipId === 'undefined' || membershipId === '') { throw new AppwriteException( 'Missing required parameter: "membershipId"', ); @@ -1259,6 +1260,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -1345,10 +1347,10 @@ export class Teams { const membershipId = params.membershipId; const userId = params.userId; const secret = params.secret; - if (typeof teamId === 'undefined') { + if (typeof teamId === 'undefined' || teamId === '') { throw new AppwriteException('Missing required parameter: "teamId"'); } - if (typeof membershipId === 'undefined') { + if (typeof membershipId === 'undefined' || membershipId === '') { throw new AppwriteException( 'Missing required parameter: "membershipId"', ); @@ -1422,7 +1424,7 @@ export class Teams { } const teamId = params.teamId; - if (typeof teamId === 'undefined') { + if (typeof teamId === 'undefined' || teamId === '') { throw new AppwriteException('Missing required parameter: "teamId"'); } const apiPath = '/teams/{teamId}/prefs'.replace( @@ -1486,7 +1488,7 @@ export class Teams { const teamId = params.teamId; const prefs = params.prefs; - if (typeof teamId === 'undefined') { + if (typeof teamId === 'undefined' || teamId === '') { throw new AppwriteException('Missing required parameter: "teamId"'); } if (typeof prefs === 'undefined') { diff --git a/src/services/tokens.ts b/src/services/tokens.ts index fcd24db9..796ccf9a 100644 --- a/src/services/tokens.ts +++ b/src/services/tokens.ts @@ -83,12 +83,12 @@ export class Tokens { const fileId = params.fileId; const queries = params.queries; const total = params.total; - if (typeof bucketId === 'undefined') { + if (typeof bucketId === 'undefined' || bucketId === '') { throw new AppwriteException( 'Missing required parameter: "bucketId"', ); } - if (typeof fileId === 'undefined') { + if (typeof fileId === 'undefined' || fileId === '') { throw new AppwriteException('Missing required parameter: "fileId"'); } const apiPath = '/tokens/buckets/{bucketId}/files/{fileId}' @@ -168,12 +168,12 @@ export class Tokens { const bucketId = params.bucketId; const fileId = params.fileId; const expire = params.expire; - if (typeof bucketId === 'undefined') { + if (typeof bucketId === 'undefined' || bucketId === '') { throw new AppwriteException( 'Missing required parameter: "bucketId"', ); } - if (typeof fileId === 'undefined') { + if (typeof fileId === 'undefined' || fileId === '') { throw new AppwriteException('Missing required parameter: "fileId"'); } const apiPath = '/tokens/buckets/{bucketId}/files/{fileId}' @@ -229,7 +229,7 @@ export class Tokens { } const tokenId = params.tokenId; - if (typeof tokenId === 'undefined') { + if (typeof tokenId === 'undefined' || tokenId === '') { throw new AppwriteException( 'Missing required parameter: "tokenId"', ); @@ -295,7 +295,7 @@ export class Tokens { const tokenId = params.tokenId; const expire = params.expire; - if (typeof tokenId === 'undefined') { + if (typeof tokenId === 'undefined' || tokenId === '') { throw new AppwriteException( 'Missing required parameter: "tokenId"', ); @@ -352,7 +352,7 @@ export class Tokens { } const tokenId = params.tokenId; - if (typeof tokenId === 'undefined') { + if (typeof tokenId === 'undefined' || tokenId === '') { throw new AppwriteException( 'Missing required parameter: "tokenId"', ); @@ -367,6 +367,7 @@ export class Tokens { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); diff --git a/src/services/users.ts b/src/services/users.ts index be306a87..02100466 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -14,7 +14,7 @@ export class Users { /** * Get a list of all the project's users. You can use the query params to filter your results. * - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator, accessedAt + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, passwordPwned, labels, impersonator, accessedAt * @param {string} params.search - Search term to filter your list results. Max length: 256 chars. * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} @@ -30,7 +30,7 @@ export class Users { /** * Get a list of all the project's users. You can use the query params to filter your results. * - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator, accessedAt + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, passwordPwned, labels, impersonator, accessedAt * @param {string} search - Search term to filter your list results. Max length: 256 chars. * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} @@ -50,7 +50,7 @@ export class Users { let params: { queries?: string[]; search?: string; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -470,7 +470,7 @@ export class Users { let params: { queries?: string[]; search?: string; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -547,7 +547,7 @@ export class Users { } const identityId = params.identityId; - if (typeof identityId === 'undefined') { + if (typeof identityId === 'undefined' || identityId === '') { throw new AppwriteException( 'Missing required parameter: "identityId"', ); @@ -562,6 +562,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -1338,7 +1339,7 @@ export class Users { } const userId = params.userId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}'.replace( @@ -1389,7 +1390,7 @@ export class Users { } const userId = params.userId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}'.replace( @@ -1402,6 +1403,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -1456,7 +1458,7 @@ export class Users { const userId = params.userId; const email = params.email; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } if (typeof email === 'undefined') { @@ -1482,7 +1484,7 @@ export class Users { } /** - * Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data. + * Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data. Account endpoints are read-only while impersonating: they report the target's account, and anything that would change it is refused, so an impersonator cannot alter the target's credentials or delete their account. * * * @param {string} params.userId - User ID. @@ -1497,7 +1499,7 @@ export class Users { impersonator: boolean; }): Promise>; /** - * Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data. + * Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data. Account endpoints are read-only while impersonating: they report the target's account, and anything that would change it is refused, so an impersonator cannot alter the target's credentials or delete their account. * * * @param {string} userId - User ID. @@ -1535,7 +1537,7 @@ export class Users { const userId = params.userId; const impersonator = params.impersonator; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } if (typeof impersonator === 'undefined') { @@ -1619,7 +1621,7 @@ export class Users { const userId = params.userId; const sessionId = params.sessionId; const duration = params.duration; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/jwts'.replace( @@ -1700,7 +1702,7 @@ export class Users { const userId = params.userId; const labels = params.labels; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } if (typeof labels === 'undefined') { @@ -1725,87 +1727,6 @@ export class Users { return this.client.call('put', uri, apiHeaders, apiPayload); } - /** - * Get the user activity logs list by its unique ID. - * - * @param {string} params.userId - User ID. - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset - * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - */ - listLogs(params: { - userId: string; - queries?: string[]; - total?: boolean; - }): Promise; - /** - * Get the user activity logs list by its unique ID. - * - * @param {string} userId - User ID. - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset - * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listLogs( - userId: string, - queries?: string[], - total?: boolean, - ): Promise; - listLogs( - paramsOrFirst: - { userId: string; queries?: string[]; total?: boolean } | string, - ...rest: [string[]?, boolean?] - ): Promise { - let params: { userId: string; queries?: string[]; total?: boolean }; - - if ( - paramsOrFirst && - typeof paramsOrFirst === 'object' && - !Array.isArray(paramsOrFirst) - ) { - params = (paramsOrFirst || {}) as { - userId: string; - queries?: string[]; - total?: boolean; - }; - } else { - params = { - userId: paramsOrFirst as string, - queries: rest[0] as string[], - total: rest[1] as boolean, - }; - } - - const userId = params.userId; - const queries = params.queries; - const total = params.total; - if (typeof userId === 'undefined') { - throw new AppwriteException('Missing required parameter: "userId"'); - } - const apiPath = '/users/{userId}/logs'.replace( - '{userId}', - encodeURIComponent(String(userId)), - ); - const apiPayload: Payload = {}; - if (typeof queries !== 'undefined') { - apiPayload['queries'] = queries; - } - if (typeof total !== 'undefined') { - apiPayload['total'] = total; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'X-Appwrite-Project': this.client.config.project, - accept: 'application/json', - }; - - return this.client.call('get', uri, apiHeaders, apiPayload); - } - /** * Get the user membership list by its unique ID. * @@ -1881,7 +1802,7 @@ export class Users { const queries = params.queries; const search = params.search; const total = params.total; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/memberships'.replace( @@ -1958,7 +1879,7 @@ export class Users { const userId = params.userId; const mfa = params.mfa; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } if (typeof mfa === 'undefined') { @@ -2032,7 +1953,7 @@ export class Users { const userId = params.userId; const mfa = params.mfa; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } if (typeof mfa === 'undefined') { @@ -2107,7 +2028,7 @@ export class Users { const userId = params.userId; const type = params.type; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } if (typeof type === 'undefined') { @@ -2122,6 +2043,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -2176,7 +2098,7 @@ export class Users { const userId = params.userId; const type = params.type; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } if (typeof type === 'undefined') { @@ -2191,6 +2113,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -2245,10 +2168,10 @@ export class Users { const userId = params.userId; const challengeId = params.challengeId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof challengeId === 'undefined') { + if (typeof challengeId === 'undefined' || challengeId === '') { throw new AppwriteException( 'Missing required parameter: "challengeId"', ); @@ -2303,7 +2226,7 @@ export class Users { } const userId = params.userId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/mfa/factors'.replace( @@ -2356,7 +2279,7 @@ export class Users { } const userId = params.userId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/mfa/factors'.replace( @@ -2412,7 +2335,7 @@ export class Users { } const userId = params.userId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/mfa/recovery-codes'.replace( @@ -2467,7 +2390,7 @@ export class Users { } const userId = params.userId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/mfa/recovery-codes'.replace( @@ -2523,7 +2446,7 @@ export class Users { } const userId = params.userId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/mfa/recovery-codes'.replace( @@ -2579,7 +2502,7 @@ export class Users { } const userId = params.userId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/mfa/recovery-codes'.replace( @@ -2636,7 +2559,7 @@ export class Users { } const userId = params.userId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/mfa/recovery-codes'.replace( @@ -2692,7 +2615,7 @@ export class Users { } const userId = params.userId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/mfa/recovery-codes'.replace( @@ -2760,7 +2683,7 @@ export class Users { const userId = params.userId; const name = params.name; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } if (typeof name === 'undefined') { @@ -2837,7 +2760,7 @@ export class Users { const userId = params.userId; const password = params.password; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } if (typeof password === 'undefined') { @@ -2916,7 +2839,7 @@ export class Users { const userId = params.userId; const number = params.number; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } if (typeof number === 'undefined') { @@ -2980,7 +2903,7 @@ export class Users { } const userId = params.userId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/prefs'.replace( @@ -3044,7 +2967,7 @@ export class Users { const userId = params.userId; const prefs = params.prefs; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } if (typeof prefs === 'undefined') { @@ -3115,7 +3038,7 @@ export class Users { const userId = params.userId; const total = params.total; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/sessions'.replace( @@ -3175,7 +3098,7 @@ export class Users { } const userId = params.userId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/sessions'.replace( @@ -3227,7 +3150,7 @@ export class Users { } const userId = params.userId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/sessions'.replace( @@ -3240,6 +3163,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -3288,10 +3212,10 @@ export class Users { const userId = params.userId; const sessionId = params.sessionId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof sessionId === 'undefined') { + if (typeof sessionId === 'undefined' || sessionId === '') { throw new AppwriteException( 'Missing required parameter: "sessionId"', ); @@ -3305,6 +3229,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -3362,7 +3287,7 @@ export class Users { const userId = params.userId; const status = params.status; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } if (typeof status === 'undefined') { @@ -3444,7 +3369,7 @@ export class Users { const userId = params.userId; const queries = params.queries; const total = params.total; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/targets'.replace( @@ -3561,7 +3486,7 @@ export class Users { const identifier = params.identifier; const providerId = params.providerId; const name = params.name; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } if (typeof targetId === 'undefined') { @@ -3656,10 +3581,10 @@ export class Users { const userId = params.userId; const targetId = params.targetId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof targetId === 'undefined') { + if (typeof targetId === 'undefined' || targetId === '') { throw new AppwriteException( 'Missing required parameter: "targetId"', ); @@ -3762,10 +3687,10 @@ export class Users { const identifier = params.identifier; const providerId = params.providerId; const name = params.name; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof targetId === 'undefined') { + if (typeof targetId === 'undefined' || targetId === '') { throw new AppwriteException( 'Missing required parameter: "targetId"', ); @@ -3837,10 +3762,10 @@ export class Users { const userId = params.userId; const targetId = params.targetId; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof targetId === 'undefined') { + if (typeof targetId === 'undefined' || targetId === '') { throw new AppwriteException( 'Missing required parameter: "targetId"', ); @@ -3854,6 +3779,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -3918,7 +3844,7 @@ export class Users { const userId = params.userId; const length = params.length; const expire = params.expire; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/tokens'.replace( @@ -3998,7 +3924,7 @@ export class Users { const userId = params.userId; const emailVerification = params.emailVerification; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } if (typeof emailVerification === 'undefined') { @@ -4080,7 +4006,7 @@ export class Users { const userId = params.userId; const phoneVerification = params.phoneVerification; - if (typeof userId === 'undefined') { + if (typeof userId === 'undefined' || userId === '') { throw new AppwriteException('Missing required parameter: "userId"'); } if (typeof phoneVerification === 'undefined') { diff --git a/src/services/vectors-db.ts b/src/services/vectors-db.ts index 59fec93c..7938a17a 100644 --- a/src/services/vectors-db.ts +++ b/src/services/vectors-db.ts @@ -39,7 +39,7 @@ export class VectorsDB { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -210,7 +210,7 @@ export class VectorsDB { } /** - * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, pricing, and whether it is enabled for the organization. + * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, its own prices and overage rates, and whether it is enabled for the organization. * * @throws {AppwriteException} * @returns {Promise} @@ -253,7 +253,7 @@ export class VectorsDB { let params: { queries?: string[] }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -304,7 +304,7 @@ export class VectorsDB { let params: { ttl?: number }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -370,7 +370,7 @@ export class VectorsDB { } const transactionId = params.transactionId; - if (typeof transactionId === 'undefined') { + if (typeof transactionId === 'undefined' || transactionId === '') { throw new AppwriteException( 'Missing required parameter: "transactionId"', ); @@ -452,7 +452,7 @@ export class VectorsDB { const transactionId = params.transactionId; const commit = params.commit; const rollback = params.rollback; - if (typeof transactionId === 'undefined') { + if (typeof transactionId === 'undefined' || transactionId === '') { throw new AppwriteException( 'Missing required parameter: "transactionId"', ); @@ -514,7 +514,7 @@ export class VectorsDB { } const transactionId = params.transactionId; - if (typeof transactionId === 'undefined') { + if (typeof transactionId === 'undefined' || transactionId === '') { throw new AppwriteException( 'Missing required parameter: "transactionId"', ); @@ -529,6 +529,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -584,7 +585,7 @@ export class VectorsDB { const transactionId = params.transactionId; const operations = params.operations; - if (typeof transactionId === 'undefined') { + if (typeof transactionId === 'undefined' || transactionId === '') { throw new AppwriteException( 'Missing required parameter: "transactionId"', ); @@ -644,7 +645,7 @@ export class VectorsDB { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -757,7 +758,7 @@ export class VectorsDB { const specification = params.specification; const replicas = params.replicas; const syncMode = params.syncMode; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -829,7 +830,7 @@ export class VectorsDB { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -844,6 +845,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -924,7 +926,7 @@ export class VectorsDB { const queries = params.queries; const search = params.search; const total = params.total; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1055,7 +1057,7 @@ export class VectorsDB { const permissions = params.permissions; const documentSecurity = params.documentSecurity; const enabled = params.enabled; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -1156,12 +1158,12 @@ export class VectorsDB { const databaseId = params.databaseId; const collectionId = params.collectionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1285,12 +1287,12 @@ export class VectorsDB { const permissions = params.permissions; const documentSecurity = params.documentSecurity; const enabled = params.enabled; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1377,12 +1379,12 @@ export class VectorsDB { const databaseId = params.databaseId; const collectionId = params.collectionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1399,6 +1401,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -1499,12 +1502,12 @@ export class VectorsDB { const transactionId = params.transactionId; const total = params.total; const ttl = params.ttl; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1659,12 +1662,12 @@ export class VectorsDB { const data = params.data; const permissions = params.permissions; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1785,12 +1788,12 @@ export class VectorsDB { const collectionId = params.collectionId; const documents = params.documents; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -1904,12 +1907,12 @@ export class VectorsDB { const collectionId = params.collectionId; const documents = params.documents; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -2030,12 +2033,12 @@ export class VectorsDB { const data = params.data; const queries = params.queries; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -2145,12 +2148,12 @@ export class VectorsDB { const collectionId = params.collectionId; const queries = params.queries; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -2277,12 +2280,12 @@ export class VectorsDB { const transactionId = params.transactionId; const total = params.total; const ttl = params.ttl; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -2404,17 +2407,17 @@ export class VectorsDB { const documentId = params.documentId; const queries = params.queries; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof documentId === 'undefined') { + if (typeof documentId === 'undefined' || documentId === '') { throw new AppwriteException( 'Missing required parameter: "documentId"', ); @@ -2569,17 +2572,17 @@ export class VectorsDB { const data = params.data; const permissions = params.permissions; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof documentId === 'undefined') { + if (typeof documentId === 'undefined' || documentId === '') { throw new AppwriteException( 'Missing required parameter: "documentId"', ); @@ -2738,17 +2741,17 @@ export class VectorsDB { const data = params.data; const permissions = params.permissions; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof documentId === 'undefined') { + if (typeof documentId === 'undefined' || documentId === '') { throw new AppwriteException( 'Missing required parameter: "documentId"', ); @@ -2860,17 +2863,17 @@ export class VectorsDB { const collectionId = params.collectionId; const documentId = params.documentId; const transactionId = params.transactionId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof documentId === 'undefined') { + if (typeof documentId === 'undefined' || documentId === '') { throw new AppwriteException( 'Missing required parameter: "documentId"', ); @@ -2895,6 +2898,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -2975,12 +2979,12 @@ export class VectorsDB { const collectionId = params.collectionId; const queries = params.queries; const total = params.total; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -3120,12 +3124,12 @@ export class VectorsDB { const attributes = params.attributes; const orders = params.orders; const lengths = params.lengths; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); @@ -3232,17 +3236,17 @@ export class VectorsDB { const databaseId = params.databaseId; const collectionId = params.collectionId; const key = params.key; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } const apiPath = @@ -3321,17 +3325,17 @@ export class VectorsDB { const databaseId = params.databaseId; const collectionId = params.collectionId; const key = params.key; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); } - if (typeof collectionId === 'undefined') { + if (typeof collectionId === 'undefined' || collectionId === '') { throw new AppwriteException( 'Missing required parameter: "collectionId"', ); } - if (typeof key === 'undefined') { + if (typeof key === 'undefined' || key === '') { throw new AppwriteException('Missing required parameter: "key"'); } const apiPath = @@ -3348,6 +3352,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -3403,7 +3408,7 @@ export class VectorsDB { const databaseId = params.databaseId; const targetReplicaId = params.targetReplicaId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -3502,7 +3507,7 @@ export class VectorsDB { const status = params.status; const limit = params.limit; const offset = params.offset; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -3568,7 +3573,7 @@ export class VectorsDB { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); @@ -3623,7 +3628,7 @@ export class VectorsDB { } const databaseId = params.databaseId; - if (typeof databaseId === 'undefined') { + if (typeof databaseId === 'undefined' || databaseId === '') { throw new AppwriteException( 'Missing required parameter: "databaseId"', ); diff --git a/src/services/webhooks.ts b/src/services/webhooks.ts index b63c750c..748e9a81 100644 --- a/src/services/webhooks.ts +++ b/src/services/webhooks.ts @@ -37,7 +37,7 @@ export class Webhooks { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -291,7 +291,7 @@ export class Webhooks { } const webhookId = params.webhookId; - if (typeof webhookId === 'undefined') { + if (typeof webhookId === 'undefined' || webhookId === '') { throw new AppwriteException( 'Missing required parameter: "webhookId"', ); @@ -430,7 +430,7 @@ export class Webhooks { const tls = params.tls; const authUsername = params.authUsername; const authPassword = params.authPassword; - if (typeof webhookId === 'undefined') { + if (typeof webhookId === 'undefined' || webhookId === '') { throw new AppwriteException( 'Missing required parameter: "webhookId"', ); @@ -514,7 +514,7 @@ export class Webhooks { } const webhookId = params.webhookId; - if (typeof webhookId === 'undefined') { + if (typeof webhookId === 'undefined' || webhookId === '') { throw new AppwriteException( 'Missing required parameter: "webhookId"', ); @@ -529,6 +529,7 @@ export class Webhooks { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + accept: 'application/json', }; return this.client.call('delete', uri, apiHeaders, apiPayload); @@ -580,7 +581,7 @@ export class Webhooks { const webhookId = params.webhookId; const secret = params.secret; - if (typeof webhookId === 'undefined') { + if (typeof webhookId === 'undefined' || webhookId === '') { throw new AppwriteException( 'Missing required parameter: "webhookId"', ); diff --git a/test/services/account.test.js b/test/services/account.test.js index 3f7f45e7..5308e907 100644 --- a/test/services/account.test.js +++ b/test/services/account.test.js @@ -219,19 +219,6 @@ describe('Account', () => { expect(response).toEqual(data); }); - test('test method listLogs()', async () => { - const data = { - total: 5, - logs: [], - }; - mockedFetch.mockImplementation(() => Response.json(data)); - const response = await account.listLogs(); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); test('test method updateMFA()', async () => { const data = { '\\$id': '5e5ea5c16897e', @@ -738,6 +725,44 @@ describe('Account', () => { expect(response).toEqual(data); }); + test('test method createRecoveryOTP()', async () => { + const data = { + '\\$id': 'bb8ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + userId: '5e5ea5c168bb8', + secret: '', + expire: '2020-10-15T06:38:00.000+00:00', + phrase: 'Golden Fox', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await account.createRecoveryOTP('email@example.com'); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateRecoveryOTP()', async () => { + const data = { + '\\$id': 'bb8ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + userId: '5e5ea5c168bb8', + secret: '', + expire: '2020-10-15T06:38:00.000+00:00', + phrase: 'Golden Fox', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await account.updateRecoveryOTP( + '', + '', + 'password', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); test('test method listSessions()', async () => { const data = { total: 5, @@ -844,6 +869,49 @@ describe('Account', () => { expect(response).toEqual(data); }); + test('test method createIdTokenSession()', async () => { + const data = { + '\\$id': '5e5ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + userId: '5e5bb8c16897e', + expire: '2020-10-15T06:38:00.000+00:00', + provider: 'email', + providerUid: 'user@example.com', + providerAccessToken: 'MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3', + providerAccessTokenExpiry: '2020-10-15T06:38:00.000+00:00', + providerRefreshToken: 'MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3', + ip: '127.0.0.1', + osCode: 'Mac', + osName: 'Mac', + osVersion: 'Mac', + clientType: 'browser', + clientCode: 'CM', + clientName: 'Chrome Mobile iOS', + clientVersion: '84.0', + clientEngine: 'WebKit', + clientEngineVersion: '605.1.15', + deviceName: 'smartphone', + deviceBrand: 'Google', + deviceModel: 'Nexus 5', + countryCode: 'US', + countryName: 'United States', + current: true, + factors: [], + secret: '5e5bb8c16897e', + mfaUpdatedAt: '2020-10-15T06:38:00.000+00:00', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await account.createIdTokenSession( + 'apple', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); test('test method updateMagicURLSession()', async () => { const data = { '\\$id': '5e5ea5c16897e', @@ -1235,6 +1303,43 @@ describe('Account', () => { expect(response).toEqual(data); }); + test('test method createEmailVerificationOTP()', async () => { + const data = { + '\\$id': 'bb8ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + userId: '5e5ea5c168bb8', + secret: '', + expire: '2020-10-15T06:38:00.000+00:00', + phrase: 'Golden Fox', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await account.createEmailVerificationOTP(); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateEmailVerificationOTP()', async () => { + const data = { + '\\$id': 'bb8ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + userId: '5e5ea5c168bb8', + secret: '', + expire: '2020-10-15T06:38:00.000+00:00', + phrase: 'Golden Fox', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await account.updateEmailVerificationOTP( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); test('test method createPhoneVerification()', async () => { const data = { '\\$id': 'bb8ea5c16897e', diff --git a/test/services/documents-d-b.test.js b/test/services/documents-d-b.test.js index 75f1be0e..3042c582 100644 --- a/test/services/documents-d-b.test.js +++ b/test/services/documents-d-b.test.js @@ -45,7 +45,6 @@ describe('DocumentsDB', () => { const data = { specifications: [], total: 9, - pricing: {}, }; mockedFetch.mockImplementation(() => Response.json(data)); const response = await documentsDB.listSpecifications(); @@ -636,6 +635,8 @@ describe('DocumentsDB', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -649,7 +650,7 @@ describe('DocumentsDB', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, diff --git a/test/services/domains.test.js b/test/services/domains.test.js new file mode 100644 index 00000000..18e3e3c3 --- /dev/null +++ b/test/services/domains.test.js @@ -0,0 +1,1003 @@ +const { Client } = require('../../dist/client'); +const { Domains } = require('../../dist/services/domains'); + +const { fetch: mockedFetch, Response } = require('undici'); +jest.mock('undici', () => ({ + ...jest.requireActual('undici'), + fetch: jest.fn(), +})); + +describe('Domains', () => { + const client = new Client(); + const domains = new Domains(client); + + test('test method list()', async () => { + const data = { + total: 5, + domains: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.list(); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method create()', async () => { + const data = { + '\\$id': '5e5ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + domain: 'example.com', + registrar: 'appwrite', + nameservers: 'Appwrite', + expire: '2020-10-15T06:38:00.000+00:00', + renewal: '2020-10-15T06:38:00.000+00:00', + autoRenewal: true, + renewalPrice: 2599, + teamId: '5e5ea5c16897e', + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.create('', 'example.com'); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method getPrice()', async () => { + const data = { + domain: 'example.com', + tld: 'com', + available: true, + periodYears: 1, + premium: true, + renewalPeriodYears: 1, + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.getPrice('example.com'); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listPrices()', async () => { + const data = { + total: 5, + prices: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.listPrices([]); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method get()', async () => { + const data = { + '\\$id': '5e5ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + domain: 'example.com', + registrar: 'appwrite', + nameservers: 'Appwrite', + expire: '2020-10-15T06:38:00.000+00:00', + renewal: '2020-10-15T06:38:00.000+00:00', + autoRenewal: true, + renewalPrice: 2599, + teamId: '5e5ea5c16897e', + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.get(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method delete()', async () => { + const data = { message: '' }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.delete(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateNameservers()', async () => { + const data = { + '\\$id': '5e5ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + domain: 'example.com', + registrar: 'appwrite', + nameservers: 'Appwrite', + expire: '2020-10-15T06:38:00.000+00:00', + renewal: '2020-10-15T06:38:00.000+00:00', + autoRenewal: true, + renewalPrice: 2599, + teamId: '5e5ea5c16897e', + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.updateNameservers(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method verifyNameservers()', async () => { + const data = { + '\\$id': '5e5ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + domain: 'example.com', + registrar: 'appwrite', + nameservers: 'Appwrite', + expire: '2020-10-15T06:38:00.000+00:00', + renewal: '2020-10-15T06:38:00.000+00:00', + autoRenewal: true, + renewalPrice: 2599, + teamId: '5e5ea5c16897e', + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.verifyNameservers(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method getPresetGoogleWorkspace()', async () => { + const data = { + total: 5, + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.getPresetGoogleWorkspace(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createPresetGoogleWorkspace()', async () => { + const data = { + total: 5, + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = + await domains.createPresetGoogleWorkspace(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method getPresetICloud()', async () => { + const data = { + total: 5, + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.getPresetICloud(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createPresetICloud()', async () => { + const data = { + total: 5, + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.createPresetICloud(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method getPresetMailgun()', async () => { + const data = { + total: 5, + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.getPresetMailgun(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createPresetMailgun()', async () => { + const data = { + total: 5, + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.createPresetMailgun(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method getPresetOutlook()', async () => { + const data = { + total: 5, + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.getPresetOutlook(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createPresetOutlook()', async () => { + const data = { + total: 5, + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.createPresetOutlook(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method getPresetProtonMail()', async () => { + const data = { + total: 5, + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.getPresetProtonMail(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createPresetProtonMail()', async () => { + const data = { + total: 5, + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.createPresetProtonMail(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method getPresetZoho()', async () => { + const data = { + total: 5, + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.getPresetZoho(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createPresetZoho()', async () => { + const data = { + total: 5, + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.createPresetZoho(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listRecords()', async () => { + const data = { + total: 5, + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.listRecords(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createRecordA()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.createRecordA('', '', '', 1); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateRecordA()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.updateRecordA( + '', + '', + '', + '', + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createRecordAAAA()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.createRecordAAAA( + '', + '', + '', + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateRecordAAAA()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.updateRecordAAAA( + '', + '', + '', + '', + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createRecordAlias()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.createRecordAlias( + '', + '', + '', + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateRecordAlias()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.updateRecordAlias( + '', + '', + '', + '', + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createRecordCAA()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.createRecordCAA( + '', + '', + '', + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateRecordCAA()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.updateRecordCAA( + '', + '', + '', + '', + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createRecordCNAME()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.createRecordCNAME( + '', + '', + '', + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateRecordCNAME()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.updateRecordCNAME( + '', + '', + '', + '', + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createRecordHTTPS()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.createRecordHTTPS( + '', + '', + '', + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateRecordHTTPS()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.updateRecordHTTPS( + '', + '', + '', + '', + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createRecordMX()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.createRecordMX( + '', + '', + '', + 1, + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateRecordMX()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.updateRecordMX( + '', + '', + '', + '', + 1, + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createRecordNS()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.createRecordNS( + '', + '', + '', + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateRecordNS()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.updateRecordNS( + '', + '', + '', + '', + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createRecordSRV()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.createRecordSRV( + '', + '', + '', + 1, + 1, + 1, + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateRecordSRV()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.updateRecordSRV( + '', + '', + '', + '', + 1, + 1, + 1, + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createRecordTXT()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.createRecordTXT('', '', 1); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateRecordTXT()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.updateRecordTXT( + '', + '', + '', + '', + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method getRecord()', async () => { + const data = { + '\\$id': '5f40a6e10c65e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + type: 'A', + name: 'mail', + value: '192.0.2.1', + ttl: 86400, + priority: 10, + lock: true, + weight: 10, + port: 443, + comment: 'Mail server record', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.getRecord('', ''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method deleteRecord()', async () => { + const data = { message: '' }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.deleteRecord( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateTeam()', async () => { + const data = { + '\\$id': '5e5ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + domain: 'example.com', + registrar: 'appwrite', + nameservers: 'Appwrite', + expire: '2020-10-15T06:38:00.000+00:00', + renewal: '2020-10-15T06:38:00.000+00:00', + autoRenewal: true, + renewalPrice: 2599, + teamId: '5e5ea5c16897e', + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.updateTeam('', ''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method getTransferStatus()', async () => { + const data = { + status: 'pending_registry', + reason: 'Transfer in progress', + timestamp: '2020-10-15T06:38:00.000+00:00', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.getTransferStatus(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method getZone()', async () => { + const data = { message: '' }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.getZone(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateZone()', async () => { + const data = { + '\\$id': '5e5ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + domain: 'example.com', + registrar: 'appwrite', + nameservers: 'Appwrite', + expire: '2020-10-15T06:38:00.000+00:00', + renewal: '2020-10-15T06:38:00.000+00:00', + autoRenewal: true, + renewalPrice: 2599, + teamId: '5e5ea5c16897e', + dnsRecords: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await domains.updateZone('', ''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); +}); diff --git a/test/services/functions.test.js b/test/services/functions.test.js index 62c32e06..fba574bb 100644 --- a/test/services/functions.test.js +++ b/test/services/functions.test.js @@ -581,7 +581,7 @@ describe('Functions', () => { responseHeaders: [], logs: '', errors: '', - duration: 0.4, + duration: 1.23, }; mockedFetch.mockImplementation(() => Response.json(data)); const response = await functions.createExecution(''); @@ -610,7 +610,7 @@ describe('Functions', () => { responseHeaders: [], logs: '', errors: '', - duration: 0.4, + duration: 1.23, }; mockedFetch.mockImplementation(() => Response.json(data)); const response = await functions.getExecution( diff --git a/test/services/messaging.test.js b/test/services/messaging.test.js index 5afb42c2..25df258a 100644 --- a/test/services/messaging.test.js +++ b/test/services/messaging.test.js @@ -335,6 +335,48 @@ describe('Messaging', () => { expect(response).toEqual(data); }); + test('test method createAppwriteProvider()', async () => { + const data = { + '\\$id': '5e5ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + name: 'Mailgun', + provider: 'mailgun', + enabled: true, + type: 'sms', + credentials: {}, + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await messaging.createAppwriteProvider( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateAppwriteProvider()', async () => { + const data = { + '\\$id': '5e5ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + name: 'Mailgun', + provider: 'mailgun', + enabled: true, + type: 'sms', + credentials: {}, + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = + await messaging.updateAppwriteProvider(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); test('test method createFcmProvider()', async () => { const data = { '\\$id': '5e5ea5c16897e', diff --git a/test/services/mongo.test.js b/test/services/mongo.test.js index e70b2bea..7c90bbf3 100644 --- a/test/services/mongo.test.js +++ b/test/services/mongo.test.js @@ -51,6 +51,8 @@ describe('Mongo', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -64,7 +66,7 @@ describe('Mongo', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -87,7 +89,6 @@ describe('Mongo', () => { const data = { specifications: [], total: 9, - pricing: {}, }; mockedFetch.mockImplementation(() => Response.json(data)); const response = await mongo.listSpecifications(); @@ -124,6 +125,8 @@ describe('Mongo', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -137,7 +140,7 @@ describe('Mongo', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -183,6 +186,8 @@ describe('Mongo', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -196,7 +201,7 @@ describe('Mongo', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -462,6 +467,8 @@ describe('Mongo', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -475,7 +482,7 @@ describe('Mongo', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -521,6 +528,8 @@ describe('Mongo', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -534,7 +543,7 @@ describe('Mongo', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -602,6 +611,8 @@ describe('Mongo', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -615,7 +626,7 @@ describe('Mongo', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -661,6 +672,8 @@ describe('Mongo', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -674,7 +687,7 @@ describe('Mongo', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -724,6 +737,8 @@ describe('Mongo', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -737,7 +752,7 @@ describe('Mongo', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -911,6 +926,8 @@ describe('Mongo', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -924,7 +941,7 @@ describe('Mongo', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, diff --git a/test/services/mysql.test.js b/test/services/mysql.test.js index 7ff39f86..b7ae2299 100644 --- a/test/services/mysql.test.js +++ b/test/services/mysql.test.js @@ -51,6 +51,8 @@ describe('Mysql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -64,7 +66,7 @@ describe('Mysql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -87,7 +89,6 @@ describe('Mysql', () => { const data = { specifications: [], total: 9, - pricing: {}, }; mockedFetch.mockImplementation(() => Response.json(data)); const response = await mysql.listSpecifications(); @@ -124,6 +125,8 @@ describe('Mysql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -137,7 +140,7 @@ describe('Mysql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -183,6 +186,8 @@ describe('Mysql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -196,7 +201,7 @@ describe('Mysql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -462,6 +467,8 @@ describe('Mysql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -475,7 +482,7 @@ describe('Mysql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -521,6 +528,8 @@ describe('Mysql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -534,7 +543,7 @@ describe('Mysql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -619,6 +628,8 @@ describe('Mysql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -632,7 +643,7 @@ describe('Mysql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -678,6 +689,8 @@ describe('Mysql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -691,7 +704,7 @@ describe('Mysql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -741,6 +754,8 @@ describe('Mysql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -754,7 +769,7 @@ describe('Mysql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -970,6 +985,8 @@ describe('Mysql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -983,7 +1000,7 @@ describe('Mysql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, diff --git a/test/services/oauth2.test.js b/test/services/oauth2.test.js index 7523dcf0..476045aa 100644 --- a/test/services/oauth2.test.js +++ b/test/services/oauth2.test.js @@ -54,9 +54,9 @@ describe('Oauth2', () => { device_code: '5f3c8d2a1b9e4f7a6c8b2d1e9f4a7b3c5d8e1f2a9b4c7d6e3f5a8b1c4d7e2f9a', user_code: 'ABCD-EFGH', - verification_uri: 'https://cloud.appwrite.io/console/oauth2/device', + verification_uri: 'https://appwrite.io/oauth2/device', verification_uri_complete: - 'https://cloud.appwrite.io/console/oauth2/device?user_code=ABCD-EFGH', + 'https://appwrite.io/oauth2/device?user_code=ABCD-EFGH', expires_in: 900, interval: 5, }; @@ -116,6 +116,18 @@ describe('Oauth2', () => { expect(response).toEqual(data); }); + test('test method introspect()', async () => { + const data = { + active: true, + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await oauth2.introspect(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); test('test method listOrganizations()', async () => { const data = { total: 5, diff --git a/test/services/organization.test.js b/test/services/organization.test.js index d01389af..6437dd63 100644 --- a/test/services/organization.test.js +++ b/test/services/organization.test.js @@ -173,89 +173,6 @@ describe('Organization', () => { expect(response).toEqual(data); }); - test('test method listKeys()', async () => { - const data = { - total: 5, - keys: [], - }; - mockedFetch.mockImplementation(() => Response.json(data)); - const response = await organization.listKeys(); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - test('test method createKey()', async () => { - const data = { - '\\$id': '5e5ea5c16897e', - '\\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', - name: 'My API Key', - expire: '2020-10-15T06:38:00.000+00:00', - scopes: [], - secret: '919c2d18fb5d4...a2ae413da83346ad2', - accessedAt: '2020-10-15T06:38:00.000+00:00', - sdks: [], - }; - mockedFetch.mockImplementation(() => Response.json(data)); - const response = await organization.createKey('', '', []); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - test('test method getKey()', async () => { - const data = { - '\\$id': '5e5ea5c16897e', - '\\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', - name: 'My API Key', - expire: '2020-10-15T06:38:00.000+00:00', - scopes: [], - secret: '919c2d18fb5d4...a2ae413da83346ad2', - accessedAt: '2020-10-15T06:38:00.000+00:00', - sdks: [], - }; - mockedFetch.mockImplementation(() => Response.json(data)); - const response = await organization.getKey(''); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - test('test method updateKey()', async () => { - const data = { - '\\$id': '5e5ea5c16897e', - '\\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', - name: 'My API Key', - expire: '2020-10-15T06:38:00.000+00:00', - scopes: [], - secret: '919c2d18fb5d4...a2ae413da83346ad2', - accessedAt: '2020-10-15T06:38:00.000+00:00', - sdks: [], - }; - mockedFetch.mockImplementation(() => Response.json(data)); - const response = await organization.updateKey('', '', []); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - test('test method deleteKey()', async () => { - const data = { message: '' }; - mockedFetch.mockImplementation(() => Response.json(data)); - const response = await organization.deleteKey(''); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); test('test method listMemberships()', async () => { const data = { total: 5, @@ -381,7 +298,6 @@ describe('Organization', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -422,7 +338,6 @@ describe('Organization', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -460,7 +375,6 @@ describe('Organization', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -501,6 +415,104 @@ describe('Organization', () => { // Remove custom toString method on the objects to allow for clean data comparison. delete response.toString; + expect(response).toEqual(data); + }); + test('test method listProjectKeys()', async () => { + const data = { + total: 5, + keys: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await organization.listProjectKeys(''); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createEphemeralProjectKey()', async () => { + const data = { + '\\$id': '5e5ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + name: 'My API Key', + expire: '2020-10-15T06:38:00.000+00:00', + scopes: [], + secret: '919c2d18fb5d4...a2ae413da83346ad2', + accessedAt: '2020-10-15T06:38:00.000+00:00', + sdks: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await organization.createEphemeralProjectKey( + '', + [], + 1, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method getProjectKey()', async () => { + const data = { + '\\$id': '5e5ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + name: 'My API Key', + expire: '2020-10-15T06:38:00.000+00:00', + scopes: [], + secret: '919c2d18fb5d4...a2ae413da83346ad2', + accessedAt: '2020-10-15T06:38:00.000+00:00', + sdks: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await organization.getProjectKey( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateProjectKey()', async () => { + const data = { + '\\$id': '5e5ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + name: 'My API Key', + expire: '2020-10-15T06:38:00.000+00:00', + scopes: [], + secret: '919c2d18fb5d4...a2ae413da83346ad2', + accessedAt: '2020-10-15T06:38:00.000+00:00', + sdks: [], + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await organization.updateProjectKey( + '', + '', + '', + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method deleteProjectKey()', async () => { + const data = { message: '' }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await organization.deleteProjectKey( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + expect(response).toEqual(data); }); }); diff --git a/test/services/postgresql.test.js b/test/services/postgresql.test.js index 7e8b1f65..b6c9142c 100644 --- a/test/services/postgresql.test.js +++ b/test/services/postgresql.test.js @@ -51,6 +51,8 @@ describe('Postgresql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -64,7 +66,7 @@ describe('Postgresql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -87,7 +89,6 @@ describe('Postgresql', () => { const data = { specifications: [], total: 9, - pricing: {}, }; mockedFetch.mockImplementation(() => Response.json(data)); const response = await postgresql.listSpecifications(); @@ -124,6 +125,8 @@ describe('Postgresql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -137,7 +140,7 @@ describe('Postgresql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -183,6 +186,8 @@ describe('Postgresql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -196,7 +201,7 @@ describe('Postgresql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -465,6 +470,8 @@ describe('Postgresql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -478,7 +485,7 @@ describe('Postgresql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -524,6 +531,8 @@ describe('Postgresql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -537,7 +546,7 @@ describe('Postgresql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -639,6 +648,8 @@ describe('Postgresql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -652,7 +663,7 @@ describe('Postgresql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -701,6 +712,8 @@ describe('Postgresql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -714,7 +727,7 @@ describe('Postgresql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -763,6 +776,8 @@ describe('Postgresql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -776,7 +791,7 @@ describe('Postgresql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -822,6 +837,8 @@ describe('Postgresql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -835,7 +852,7 @@ describe('Postgresql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -885,6 +902,8 @@ describe('Postgresql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -898,7 +917,7 @@ describe('Postgresql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -1117,6 +1136,8 @@ describe('Postgresql', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -1130,7 +1151,7 @@ describe('Postgresql', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, diff --git a/test/services/project.test.js b/test/services/project.test.js index 026c953a..37e8c782 100644 --- a/test/services/project.test.js +++ b/test/services/project.test.js @@ -19,7 +19,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -67,7 +66,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -188,7 +186,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -307,7 +304,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -365,6 +361,8 @@ describe('Project', () => { keyId: 'P4000000N8', teamId: 'D4000000R6', p8File: '-----BEGIN PRIVATE KEY-----MIGTAg...jy2Xbna-----END PRIVATE KEY-----', + nativeEnabled: true, + nativeClientIds: [], }; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Apple(); @@ -663,6 +661,8 @@ describe('Project', () => { '120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com', clientSecret: 'GOCSPX-2k8gsR0000000000000000VNahJj', prompt: [], + nativeEnabled: true, + nativeClientIds: [], }; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Google(); @@ -687,6 +687,21 @@ describe('Project', () => { expect(response).toEqual(data); }); + test('test method updateOAuth2Kakao()', async () => { + const data = { + '\\$id': 'github', + enabled: true, + clientId: '839ff5000000000000000000013206de', + clientSecret: 'jLNVOK00000000000000000000yJebea', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await project.updateOAuth2Kakao(); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); test('test method updateOAuth2Keycloak()', async () => { const data = { '\\$id': 'github', @@ -935,6 +950,21 @@ describe('Project', () => { expect(response).toEqual(data); }); + test('test method updateOAuth2TikTok()', async () => { + const data = { + '\\$id': 'github', + enabled: true, + clientId: 'awz000000000tyw0', + clientSecret: '6wXewM00000000000000000000yXnite', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await project.updateOAuth2TikTok(); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); test('test method updateOAuth2Tradeshift()', async () => { const data = { '\\$id': 'github', @@ -1076,9 +1106,8 @@ describe('Project', () => { const data = { '\\$id': 'github', enabled: true, - applicationId: '00001111-aaaa-2222-bbbb-3333cccc4444', - applicationSecret: 'A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u', - tenant: 'common', + clientId: '839ff5000000000000000000013206de', + clientSecret: 'jLNVOK00000000000000000000yJebea', }; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.getOAuth2Provider('amazon'); @@ -1359,7 +1388,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -1397,7 +1425,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -1435,7 +1462,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -1473,7 +1499,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -1511,7 +1536,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -1549,7 +1573,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -1587,7 +1610,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -1625,7 +1647,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -1663,7 +1684,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -1693,6 +1713,43 @@ describe('Project', () => { expect(response).toEqual(data); }); + test('test method updatePasswordPwnedPolicy()', async () => { + const data = { + '\\$id': '5e5ea5c16897e', + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + name: 'New Project', + teamId: '1592981250', + region: 'fra', + smtpEnabled: true, + smtpSenderName: 'John Appwrite', + smtpSenderEmail: 'john@appwrite.io', + smtpReplyToName: 'Support Team', + smtpReplyToEmail: 'support@appwrite.io', + smtpHost: 'mail.appwrite.io', + smtpPort: 25, + smtpUsername: 'emailuser', + smtpPassword: 'smtp-password', + smtpSecure: 'tls', + pingCount: 1, + pingedAt: '2020-10-15T06:38:00.000+00:00', + labels: [], + status: 'active', + onboarding: {}, + authMethods: [], + services: [], + protocols: [], + blocks: [], + consoleAccessedAt: '2020-10-15T06:38:00.000+00:00', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await project.updatePasswordPwnedPolicy(); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); test('test method updatePasswordStrengthPolicy()', async () => { const data = { '\\$id': 'password-dictionary', @@ -1718,7 +1775,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -1756,7 +1812,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -1794,7 +1849,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -1832,7 +1886,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -1870,7 +1923,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -1921,7 +1973,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -1959,7 +2010,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', @@ -1997,7 +2047,6 @@ describe('Project', () => { name: 'New Project', teamId: '1592981250', region: 'fra', - devKeys: [], smtpEnabled: true, smtpSenderName: 'John Appwrite', smtpSenderEmail: 'john@appwrite.io', diff --git a/test/services/sites.test.js b/test/services/sites.test.js index 7b267ce8..8e558d94 100644 --- a/test/services/sites.test.js +++ b/test/services/sites.test.js @@ -593,7 +593,7 @@ describe('Sites', () => { responseHeaders: [], logs: '', errors: '', - duration: 0.4, + duration: 1.23, }; mockedFetch.mockImplementation(() => Response.json(data)); const response = await sites.getLog('', ''); diff --git a/test/services/tables-d-b.test.js b/test/services/tables-d-b.test.js index 4c412e41..33dc9111 100644 --- a/test/services/tables-d-b.test.js +++ b/test/services/tables-d-b.test.js @@ -45,7 +45,6 @@ describe('TablesDB', () => { const data = { specifications: [], total: 9, - pricing: {}, }; mockedFetch.mockImplementation(() => Response.json(data)); const response = await tablesDB.listSpecifications(); @@ -217,6 +216,8 @@ describe('TablesDB', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -230,7 +231,7 @@ describe('TablesDB', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true, @@ -1188,6 +1189,34 @@ describe('TablesDB', () => { expect(response).toEqual(data); }); + test('test method updateRelationshipColumn()', async () => { + const data = { + key: 'fullName', + type: 'string', + status: 'available', + error: 'string', + required: true, + '\\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', + relatedTable: 'table', + relationType: 'oneToOne|oneToMany|manyToOne|manyToMany', + twoWay: true, + twoWayKey: 'string', + onDelete: 'restrict|cascade|setNull', + side: 'parent|child', + }; + mockedFetch.mockImplementation(() => Response.json(data)); + const response = await tablesDB.updateRelationshipColumn( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); test('test method createStringColumn()', async () => { const data = { key: 'fullName', @@ -1421,34 +1450,6 @@ describe('TablesDB', () => { expect(response).toEqual(data); }); - test('test method updateRelationshipColumn()', async () => { - const data = { - key: 'fullName', - type: 'string', - status: 'available', - error: 'string', - required: true, - '\\$createdAt': '2020-10-15T06:38:00.000+00:00', - '\\$updatedAt': '2020-10-15T06:38:00.000+00:00', - relatedTable: 'table', - relationType: 'oneToOne|oneToMany|manyToOne|manyToMany', - twoWay: true, - twoWayKey: 'string', - onDelete: 'restrict|cascade|setNull', - side: 'parent|child', - }; - mockedFetch.mockImplementation(() => Response.json(data)); - const response = await tablesDB.updateRelationshipColumn( - '', - '', - '', - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); test('test method listIndexes()', async () => { const data = { total: 5, diff --git a/test/services/users.test.js b/test/services/users.test.js index 0e61c5f2..31235103 100644 --- a/test/services/users.test.js +++ b/test/services/users.test.js @@ -432,19 +432,6 @@ describe('Users', () => { expect(response).toEqual(data); }); - test('test method listLogs()', async () => { - const data = { - total: 5, - logs: [], - }; - mockedFetch.mockImplementation(() => Response.json(data)); - const response = await users.listLogs(''); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); test('test method listMemberships()', async () => { const data = { total: 5, diff --git a/test/services/vectors-d-b.test.js b/test/services/vectors-d-b.test.js index ce941cda..d3b0a615 100644 --- a/test/services/vectors-d-b.test.js +++ b/test/services/vectors-d-b.test.js @@ -45,7 +45,6 @@ describe('VectorsDB', () => { const data = { specifications: [], total: 9, - pricing: {}, }; mockedFetch.mockImplementation(() => Response.json(data)); const response = await vectorsDB.listSpecifications(); @@ -608,6 +607,8 @@ describe('VectorsDB', () => { cpu: 2000, memory: 4096, storage: 100, + storageStatus: 'resizing', + storageTargetGb: 120, storageClass: 'ssd', storageMaxGb: 100, nodePool: 'db-pool-4vcpu-8gb', @@ -621,7 +622,7 @@ describe('VectorsDB', () => { pitrRetentionDays: 14, storageAutoscaling: true, storageAutoscalingThresholdPercent: 85, - storageAutoscalingMaxGb: 500, + storageAutoscalingMaxGb: 30, maintenanceWindowDay: 'sun', maintenanceWindowHourUtc: 3, metricsEnabled: true,