diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 47ba2484..ee63d526 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v6
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Use Node.js
- uses: actions/setup-node@v6
+ uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24.14.1'
registry-url: 'https://registry.npmjs.org'
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 00000000..7253a5ce
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1 @@
+min-release-age=7
diff --git a/README.md b/README.md
index daed6142..8cf6f116 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# Appwrite Console SDK

-
+
[](https://travis-ci.com/appwrite/sdk-generator)
[](https://twitter.com/appwrite)
[](https://appwrite.io/discord)
@@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console";
To install with a CDN (content delivery network) add the following scripts to the bottom of your
tag, but before you use any Appwrite services:
```html
-
+
```
diff --git a/docs/examples/account/create-key.md b/docs/examples/account/create-key.md
index 6371ff17..769228e8 100644
--- a/docs/examples/account/create-key.md
+++ b/docs/examples/account/create-key.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Account, Scopes } from "@appwrite.io/console";
+import { Client, Account, AccountKeyScopes } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -9,7 +9,7 @@ const account = new Account(client);
const result = await account.createKey({
name: '',
- scopes: [Scopes.Account],
+ scopes: [AccountKeyScopes.Account],
expire: '2020-10-15T06:38:00.000+00:00' // optional
});
diff --git a/docs/examples/account/update-key.md b/docs/examples/account/update-key.md
index 1975baa7..d76022b8 100644
--- a/docs/examples/account/update-key.md
+++ b/docs/examples/account/update-key.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Account, Scopes } from "@appwrite.io/console";
+import { Client, Account, AccountKeyScopes } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -10,7 +10,7 @@ const account = new Account(client);
const result = await account.updateKey({
keyId: '',
name: '',
- scopes: [Scopes.Account],
+ scopes: [AccountKeyScopes.Account],
expire: '2020-10-15T06:38:00.000+00:00' // optional
});
diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md
index 0f7a9216..45e3517f 100644
--- a/docs/examples/avatars/get-screenshot.md
+++ b/docs/examples/avatars/get-screenshot.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Avatars, Theme, Timezone, BrowserPermission, ImageFormat } from "@appwrite.io/console";
+import { Client, Avatars, BrowserTheme, Timezone, BrowserPermission, ImageFormat } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -16,11 +16,11 @@ const result = avatars.getScreenshot({
viewportWidth: 1920, // optional
viewportHeight: 1080, // optional
scale: 2, // optional
- theme: Theme.Dark, // optional
+ theme: BrowserTheme.Dark, // optional
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional
fullpage: true, // optional
locale: 'en-US', // optional
- timezone: Timezone.AmericaNewYork, // optional
+ timezone: Timezone.AfricaAbidjan, // optional
latitude: 37.7749, // optional
longitude: -122.4194, // optional
accuracy: 100, // optional
diff --git a/docs/examples/console/get-email-template.md b/docs/examples/console/get-email-template.md
new file mode 100644
index 00000000..8f16d121
--- /dev/null
+++ b/docs/examples/console/get-email-template.md
@@ -0,0 +1,16 @@
+```javascript
+import { Client, Console, ProjectEmailTemplateId, ProjectEmailTemplateLocale } from "@appwrite.io/console";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const xconsole = new Console(client);
+
+const result = await xconsole.getEmailTemplate({
+ templateId: ProjectEmailTemplateId.Verification,
+ locale: ProjectEmailTemplateLocale.Af // optional
+});
+
+console.log(result);
+```
diff --git a/docs/examples/console/list-organization-scopes.md b/docs/examples/console/list-organization-scopes.md
new file mode 100644
index 00000000..0253b965
--- /dev/null
+++ b/docs/examples/console/list-organization-scopes.md
@@ -0,0 +1,13 @@
+```javascript
+import { Client, Console } from "@appwrite.io/console";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const xconsole = new Console(client);
+
+const result = await xconsole.listOrganizationScopes();
+
+console.log(result);
+```
diff --git a/docs/examples/documentsdb/list.md b/docs/examples/documentsdb/list.md
index fa0cd866..1812eebc 100644
--- a/docs/examples/documentsdb/list.md
+++ b/docs/examples/documentsdb/list.md
@@ -9,7 +9,6 @@ const documentsDB = new DocumentsDB(client);
const result = await documentsDB.list({
queries: [], // optional
- search: '', // optional
total: false // optional
});
diff --git a/docs/examples/domains/get-price.md b/docs/examples/domains/get-price.md
index 78ffc2e0..f3baafb5 100644
--- a/docs/examples/domains/get-price.md
+++ b/docs/examples/domains/get-price.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Domains, RegistrationType } from "@appwrite.io/console";
+import { Client, Domains, DomainRegistrationType } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -10,7 +10,7 @@ const domains = new Domains(client);
const result = await domains.getPrice({
domain: '',
periodYears: null, // optional
- registrationType: RegistrationType.New // optional
+ registrationType: DomainRegistrationType.New // optional
});
console.log(result);
diff --git a/docs/examples/domains/list-suggestions.md b/docs/examples/domains/list-suggestions.md
index 429ad498..28c7b7ae 100644
--- a/docs/examples/domains/list-suggestions.md
+++ b/docs/examples/domains/list-suggestions.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Domains, FilterType } from "@appwrite.io/console";
+import { Client, Domains, DomainSuggestionType } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -11,7 +11,7 @@ const result = await domains.listSuggestions({
query: '',
tlds: [], // optional
limit: null, // optional
- filterType: FilterType.Premium, // optional
+ filterType: DomainSuggestionType.Premium, // optional
priceMax: null, // optional
priceMin: null // optional
});
diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md
index 5cd33258..c7b20209 100644
--- a/docs/examples/functions/create.md
+++ b/docs/examples/functions/create.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Functions, Runtime, Scopes } from "@appwrite.io/console";
+import { Client, Functions, FunctionRuntime, ProjectKeyScopes } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -10,7 +10,7 @@ const functions = new Functions(client);
const result = await functions.create({
functionId: '',
name: '',
- runtime: Runtime.Node145,
+ runtime: FunctionRuntime.Node145,
execute: ["any"], // optional
events: [], // optional
schedule: '', // optional
@@ -19,12 +19,14 @@ const result = await functions.create({
logging: false, // optional
entrypoint: '', // optional
commands: '', // optional
- scopes: [Scopes.ProjectRead], // optional
+ scopes: [ProjectKeyScopes.ProjectRead], // optional
installationId: '', // optional
providerRepositoryId: '', // optional
providerBranch: '', // optional
providerSilentMode: false, // optional
providerRootDirectory: '', // optional
+ providerBranches: [], // optional
+ providerPaths: [], // optional
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 0 // optional
diff --git a/docs/examples/functions/list-templates.md b/docs/examples/functions/list-templates.md
index 41bf6cb3..e28df0b4 100644
--- a/docs/examples/functions/list-templates.md
+++ b/docs/examples/functions/list-templates.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Functions, Runtimes, UseCases } from "@appwrite.io/console";
+import { Client, Functions, FunctionRuntime, FunctionTemplateUseCase } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,8 +8,8 @@ const client = new Client()
const functions = new Functions(client);
const result = await functions.listTemplates({
- runtimes: [Runtimes.Node145], // optional
- useCases: [UseCases.Starter], // optional
+ runtimes: [FunctionRuntime.Node145], // optional
+ useCases: [FunctionTemplateUseCase.Starter], // optional
limit: 1, // optional
offset: 0, // optional
total: false // optional
diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md
index cb77dea1..c84018bb 100644
--- a/docs/examples/functions/update.md
+++ b/docs/examples/functions/update.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Functions, Runtime, Scopes } from "@appwrite.io/console";
+import { Client, Functions, FunctionRuntime, ProjectKeyScopes } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -10,7 +10,7 @@ const functions = new Functions(client);
const result = await functions.update({
functionId: '',
name: '',
- runtime: Runtime.Node145, // optional
+ runtime: FunctionRuntime.Node145, // optional
execute: ["any"], // optional
events: [], // optional
schedule: '', // optional
@@ -19,12 +19,14 @@ const result = await functions.update({
logging: false, // optional
entrypoint: '', // optional
commands: '', // optional
- scopes: [Scopes.ProjectRead], // optional
+ scopes: [ProjectKeyScopes.ProjectRead], // optional
installationId: '', // optional
providerRepositoryId: '', // optional
providerBranch: '', // optional
providerSilentMode: false, // optional
providerRootDirectory: '', // optional
+ providerBranches: [], // optional
+ providerPaths: [], // optional
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 0 // optional
diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md
index f87018ff..73017db5 100644
--- a/docs/examples/health/get-failed-jobs.md
+++ b/docs/examples/health/get-failed-jobs.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Health, Name } from "@appwrite.io/console";
+import { Client, Health, HealthQueueName } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const client = new Client()
const health = new Health(client);
const result = await health.getFailedJobs({
- name: Name.V1Database,
+ name: HealthQueueName.V1Database,
threshold: null // optional
});
diff --git a/docs/examples/manager/create-block.md b/docs/examples/manager/create-block.md
index 3515e471..55346824 100644
--- a/docs/examples/manager/create-block.md
+++ b/docs/examples/manager/create-block.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Manager, ResourceType } from "@appwrite.io/console";
+import { Client, Manager, BlockResourceType } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const manager = new Manager(client);
const result = await manager.createBlock({
projectId: '',
- resourceType: ResourceType.Projects,
+ resourceType: BlockResourceType.Projects,
resourceId: '', // optional
reason: '', // optional
expiredAt: '2020-10-15T06:38:00.000+00:00' // optional
diff --git a/docs/examples/manager/delete-block.md b/docs/examples/manager/delete-block.md
index 285eee03..b9b0ded7 100644
--- a/docs/examples/manager/delete-block.md
+++ b/docs/examples/manager/delete-block.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Manager, ResourceType } from "@appwrite.io/console";
+import { Client, Manager, BlockResourceType } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const manager = new Manager(client);
const result = await manager.deleteBlock({
projectId: '',
- resourceType: ResourceType.Projects,
+ resourceType: BlockResourceType.Projects,
resourceId: '' // optional
});
diff --git a/docs/examples/manager/delete-cache.md b/docs/examples/manager/delete-cache.md
new file mode 100644
index 00000000..f8ee50c5
--- /dev/null
+++ b/docs/examples/manager/delete-cache.md
@@ -0,0 +1,20 @@
+```javascript
+import { Client, Manager, Region, CacheTarget, CacheDatabase } from "@appwrite.io/console";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+
+const manager = new Manager(client);
+
+const result = await manager.deleteCache({
+ region: Region.Fra, // optional
+ cache: CacheTarget.Cache, // optional
+ all: false, // optional
+ database: CacheDatabase.Console, // optional
+ projectId: '', // optional
+ collectionId: '', // optional
+ documentId: '' // optional
+});
+
+console.log(result);
+```
diff --git a/docs/examples/migrations/create-appwrite-migration.md b/docs/examples/migrations/create-appwrite-migration.md
index 9729806f..39d13eed 100644
--- a/docs/examples/migrations/create-appwrite-migration.md
+++ b/docs/examples/migrations/create-appwrite-migration.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Migrations, AppwriteMigrationResource, OnDuplicate } from "@appwrite.io/console";
+import { Client, Migrations, AppwriteMigrationResource, MigrationOnDuplicate } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -12,7 +12,7 @@ const result = await migrations.createAppwriteMigration({
endpoint: 'https://example.com',
projectId: '',
apiKey: '',
- onDuplicate: OnDuplicate.Fail // optional
+ onDuplicate: MigrationOnDuplicate.Fail // optional
});
console.log(result);
diff --git a/docs/examples/migrations/create-csv-import.md b/docs/examples/migrations/create-csv-import.md
index d24792b6..1a2a97d8 100644
--- a/docs/examples/migrations/create-csv-import.md
+++ b/docs/examples/migrations/create-csv-import.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Migrations, OnDuplicate } from "@appwrite.io/console";
+import { Client, Migrations, MigrationOnDuplicate } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -12,7 +12,7 @@ const result = await migrations.createCSVImport({
fileId: '',
resourceId: '',
internalFile: false, // optional
- onDuplicate: OnDuplicate.Fail // optional
+ onDuplicate: MigrationOnDuplicate.Fail // optional
});
console.log(result);
diff --git a/docs/examples/migrations/create-json-import.md b/docs/examples/migrations/create-json-import.md
index f55fc8ff..7af6d23e 100644
--- a/docs/examples/migrations/create-json-import.md
+++ b/docs/examples/migrations/create-json-import.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Migrations, OnDuplicate } from "@appwrite.io/console";
+import { Client, Migrations, MigrationOnDuplicate } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -12,7 +12,7 @@ const result = await migrations.createJSONImport({
fileId: '',
resourceId: '',
internalFile: false, // optional
- onDuplicate: OnDuplicate.Fail // optional
+ onDuplicate: MigrationOnDuplicate.Fail // optional
});
console.log(result);
diff --git a/docs/examples/organizations/create-key.md b/docs/examples/organization/create-key.md
similarity index 53%
rename from docs/examples/organizations/create-key.md
rename to docs/examples/organization/create-key.md
index a21479a7..3989d829 100644
--- a/docs/examples/organizations/create-key.md
+++ b/docs/examples/organization/create-key.md
@@ -1,16 +1,16 @@
```javascript
-import { Client, Organizations, Scopes } from "@appwrite.io/console";
+import { Client, Organization, OrganizationKeyScopes } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
.setProject(''); // Your project ID
-const organizations = new Organizations(client);
+const organization = new Organization(client);
-const result = await organizations.createKey({
- organizationId: '',
+const result = await organization.createKey({
+ keyId: '',
name: '',
- scopes: [Scopes.ProjectsRead],
+ scopes: [OrganizationKeyScopes.ProjectsRead],
expire: '2020-10-15T06:38:00.000+00:00' // optional
});
diff --git a/docs/examples/organization/create-project.md b/docs/examples/organization/create-project.md
new file mode 100644
index 00000000..aba71929
--- /dev/null
+++ b/docs/examples/organization/create-project.md
@@ -0,0 +1,17 @@
+```javascript
+import { Client, Organization, Region } from "@appwrite.io/console";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const organization = new Organization(client);
+
+const result = await organization.createProject({
+ projectId: '',
+ name: '',
+ region: Region.Fra // optional
+});
+
+console.log(result);
+```
diff --git a/docs/examples/organizations/delete-key.md b/docs/examples/organization/delete-key.md
similarity index 53%
rename from docs/examples/organizations/delete-key.md
rename to docs/examples/organization/delete-key.md
index 961fa689..7b167db8 100644
--- a/docs/examples/organizations/delete-key.md
+++ b/docs/examples/organization/delete-key.md
@@ -1,14 +1,13 @@
```javascript
-import { Client, Organizations } from "@appwrite.io/console";
+import { Client, Organization } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
.setProject(''); // Your project ID
-const organizations = new Organizations(client);
+const organization = new Organization(client);
-const result = await organizations.deleteKey({
- organizationId: '',
+const result = await organization.deleteKey({
keyId: ''
});
diff --git a/docs/examples/organization/delete-project.md b/docs/examples/organization/delete-project.md
new file mode 100644
index 00000000..db62d68c
--- /dev/null
+++ b/docs/examples/organization/delete-project.md
@@ -0,0 +1,15 @@
+```javascript
+import { Client, Organization } from "@appwrite.io/console";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const organization = new Organization(client);
+
+const result = await organization.deleteProject({
+ projectId: ''
+});
+
+console.log(result);
+```
diff --git a/docs/examples/organizations/get-key.md b/docs/examples/organization/get-key.md
similarity index 54%
rename from docs/examples/organizations/get-key.md
rename to docs/examples/organization/get-key.md
index f4d53628..d962bcae 100644
--- a/docs/examples/organizations/get-key.md
+++ b/docs/examples/organization/get-key.md
@@ -1,14 +1,13 @@
```javascript
-import { Client, Organizations } from "@appwrite.io/console";
+import { Client, Organization } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
.setProject(''); // Your project ID
-const organizations = new Organizations(client);
+const organization = new Organization(client);
-const result = await organizations.getKey({
- organizationId: '',
+const result = await organization.getKey({
keyId: ''
});
diff --git a/docs/examples/projects/get.md b/docs/examples/organization/get-project.md
similarity index 60%
rename from docs/examples/projects/get.md
rename to docs/examples/organization/get-project.md
index b8856f8e..a338b024 100644
--- a/docs/examples/projects/get.md
+++ b/docs/examples/organization/get-project.md
@@ -1,13 +1,13 @@
```javascript
-import { Client, Projects } from "@appwrite.io/console";
+import { Client, Organization } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
.setProject(''); // Your project ID
-const projects = new Projects(client);
+const organization = new Organization(client);
-const result = await projects.get({
+const result = await organization.getProject({
projectId: ''
});
diff --git a/docs/examples/organizations/list-keys.md b/docs/examples/organization/list-keys.md
similarity index 54%
rename from docs/examples/organizations/list-keys.md
rename to docs/examples/organization/list-keys.md
index a31f70d5..d52ac31f 100644
--- a/docs/examples/organizations/list-keys.md
+++ b/docs/examples/organization/list-keys.md
@@ -1,14 +1,14 @@
```javascript
-import { Client, Organizations } from "@appwrite.io/console";
+import { Client, Organization } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
.setProject(''); // Your project ID
-const organizations = new Organizations(client);
+const organization = new Organization(client);
-const result = await organizations.listKeys({
- organizationId: '',
+const result = await organization.listKeys({
+ queries: [], // optional
total: false // optional
});
diff --git a/docs/examples/projects/list.md b/docs/examples/organization/list-projects.md
similarity index 66%
rename from docs/examples/projects/list.md
rename to docs/examples/organization/list-projects.md
index b18c8210..3e4b7588 100644
--- a/docs/examples/projects/list.md
+++ b/docs/examples/organization/list-projects.md
@@ -1,13 +1,13 @@
```javascript
-import { Client, Projects } from "@appwrite.io/console";
+import { Client, Organization } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
.setProject(''); // Your project ID
-const projects = new Projects(client);
+const organization = new Organization(client);
-const result = await projects.list({
+const result = await organization.listProjects({
queries: [], // optional
search: '', // optional
total: false // optional
diff --git a/docs/examples/organizations/update-key.md b/docs/examples/organization/update-key.md
similarity index 56%
rename from docs/examples/organizations/update-key.md
rename to docs/examples/organization/update-key.md
index f8e731cd..bb97a272 100644
--- a/docs/examples/organizations/update-key.md
+++ b/docs/examples/organization/update-key.md
@@ -1,17 +1,16 @@
```javascript
-import { Client, Organizations, Scopes } from "@appwrite.io/console";
+import { Client, Organization, OrganizationKeyScopes } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
.setProject(''); // Your project ID
-const organizations = new Organizations(client);
+const organization = new Organization(client);
-const result = await organizations.updateKey({
- organizationId: '',
+const result = await organization.updateKey({
keyId: '',
name: '',
- scopes: [Scopes.ProjectsRead],
+ scopes: [OrganizationKeyScopes.ProjectsRead],
expire: '2020-10-15T06:38:00.000+00:00' // optional
});
diff --git a/docs/examples/organization/update-project.md b/docs/examples/organization/update-project.md
new file mode 100644
index 00000000..ecf77403
--- /dev/null
+++ b/docs/examples/organization/update-project.md
@@ -0,0 +1,16 @@
+```javascript
+import { Client, Organization } from "@appwrite.io/console";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const organization = new Organization(client);
+
+const result = await organization.updateProject({
+ projectId: '',
+ name: ''
+});
+
+console.log(result);
+```
diff --git a/docs/examples/organizations/get-addon-price.md b/docs/examples/organizations/get-addon-price.md
index 1f96ba39..90043327 100644
--- a/docs/examples/organizations/get-addon-price.md
+++ b/docs/examples/organizations/get-addon-price.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Organizations, Addon } from "@appwrite.io/console";
+import { Client, Organizations, OrganizationAddon } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -9,7 +9,7 @@ const organizations = new Organizations(client);
const result = await organizations.getAddonPrice({
organizationId: '',
- addon: Addon.Baa
+ addon: OrganizationAddon.Baa
});
console.log(result);
diff --git a/docs/examples/presences/delete.md b/docs/examples/presences/delete.md
new file mode 100644
index 00000000..7773d3a2
--- /dev/null
+++ b/docs/examples/presences/delete.md
@@ -0,0 +1,15 @@
+```javascript
+import { Client, Presences } from "@appwrite.io/console";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const presences = new Presences(client);
+
+const result = await presences.delete({
+ presenceId: ''
+});
+
+console.log(result);
+```
diff --git a/docs/examples/presences/get-usage.md b/docs/examples/presences/get-usage.md
new file mode 100644
index 00000000..338e339a
--- /dev/null
+++ b/docs/examples/presences/get-usage.md
@@ -0,0 +1,15 @@
+```javascript
+import { Client, Presences, UsageRange } from "@appwrite.io/console";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const presences = new Presences(client);
+
+const result = await presences.getUsage({
+ range: UsageRange.TwentyFourHours // optional
+});
+
+console.log(result);
+```
diff --git a/docs/examples/presences/get.md b/docs/examples/presences/get.md
new file mode 100644
index 00000000..c2d4ca0d
--- /dev/null
+++ b/docs/examples/presences/get.md
@@ -0,0 +1,15 @@
+```javascript
+import { Client, Presences } from "@appwrite.io/console";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const presences = new Presences(client);
+
+const result = await presences.get({
+ presenceId: ''
+});
+
+console.log(result);
+```
diff --git a/docs/examples/presences/list.md b/docs/examples/presences/list.md
new file mode 100644
index 00000000..5cd70b44
--- /dev/null
+++ b/docs/examples/presences/list.md
@@ -0,0 +1,17 @@
+```javascript
+import { Client, Presences } from "@appwrite.io/console";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const presences = new Presences(client);
+
+const result = await presences.list({
+ queries: [], // optional
+ total: false, // optional
+ ttl: 0 // optional
+});
+
+console.log(result);
+```
diff --git a/docs/examples/presences/update.md b/docs/examples/presences/update.md
new file mode 100644
index 00000000..ce1280b0
--- /dev/null
+++ b/docs/examples/presences/update.md
@@ -0,0 +1,20 @@
+```javascript
+import { Client, Presences, Permission, Role } from "@appwrite.io/console";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const presences = new Presences(client);
+
+const result = await presences.update({
+ presenceId: '',
+ status: '', // optional
+ expiresAt: '2020-10-15T06:38:00.000+00:00', // optional
+ metadata: {}, // optional
+ permissions: [Permission.read(Role.any())], // optional
+ purge: false // optional
+});
+
+console.log(result);
+```
diff --git a/docs/examples/presences/upsert.md b/docs/examples/presences/upsert.md
new file mode 100644
index 00000000..8c77a0ce
--- /dev/null
+++ b/docs/examples/presences/upsert.md
@@ -0,0 +1,19 @@
+```javascript
+import { Client, Presences, Permission, Role } from "@appwrite.io/console";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const presences = new Presences(client);
+
+const result = await presences.upsert({
+ presenceId: '',
+ status: '',
+ permissions: [Permission.read(Role.any())], // optional
+ expiresAt: '2020-10-15T06:38:00.000+00:00', // optional
+ metadata: {} // optional
+});
+
+console.log(result);
+```
diff --git a/docs/examples/project/create-ephemeral-key.md b/docs/examples/project/create-ephemeral-key.md
index c41bb809..233f3b8e 100644
--- a/docs/examples/project/create-ephemeral-key.md
+++ b/docs/examples/project/create-ephemeral-key.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Project, Scopes } from "@appwrite.io/console";
+import { Client, Project, ProjectKeyScopes } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const client = new Client()
const project = new Project(client);
const result = await project.createEphemeralKey({
- scopes: [Scopes.ProjectRead],
+ scopes: [ProjectKeyScopes.ProjectRead],
duration: 600
});
diff --git a/docs/examples/project/create-key.md b/docs/examples/project/create-key.md
index 362d4ca0..b0feb14f 100644
--- a/docs/examples/project/create-key.md
+++ b/docs/examples/project/create-key.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Project, Scopes } from "@appwrite.io/console";
+import { Client, Project, ProjectKeyScopes } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -10,7 +10,7 @@ const project = new Project(client);
const result = await project.createKey({
keyId: '',
name: '',
- scopes: [Scopes.ProjectRead],
+ scopes: [ProjectKeyScopes.ProjectRead],
expire: '2020-10-15T06:38:00.000+00:00' // optional
});
diff --git a/docs/examples/project/get-email-template.md b/docs/examples/project/get-email-template.md
index 90eb063c..48e3b230 100644
--- a/docs/examples/project/get-email-template.md
+++ b/docs/examples/project/get-email-template.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Project, EmailTemplateType, EmailTemplateLocale } from "@appwrite.io/console";
+import { Client, Project, ProjectEmailTemplateId, ProjectEmailTemplateLocale } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,8 +8,8 @@ const client = new Client()
const project = new Project(client);
const result = await project.getEmailTemplate({
- templateId: EmailTemplateType.Verification,
- locale: EmailTemplateLocale.Af // optional
+ templateId: ProjectEmailTemplateId.Verification,
+ locale: ProjectEmailTemplateLocale.Af // optional
});
console.log(result);
diff --git a/docs/examples/project/get-o-auth-2-provider.md b/docs/examples/project/get-o-auth-2-provider.md
index cb07b451..ed4d8092 100644
--- a/docs/examples/project/get-o-auth-2-provider.md
+++ b/docs/examples/project/get-o-auth-2-provider.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Project, OAuthProvider } from "@appwrite.io/console";
+import { Client, Project, ProjectOAuthProviderId } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const client = new Client()
const project = new Project(client);
const result = await project.getOAuth2Provider({
- providerId: OAuthProvider.Amazon
+ providerId: ProjectOAuthProviderId.Amazon
});
console.log(result);
diff --git a/docs/examples/project/get-policy.md b/docs/examples/project/get-policy.md
index 45fec071..be06807f 100644
--- a/docs/examples/project/get-policy.md
+++ b/docs/examples/project/get-policy.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Project, ProjectPolicy } from "@appwrite.io/console";
+import { Client, Project, ProjectPolicyId } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const client = new Client()
const project = new Project(client);
const result = await project.getPolicy({
- policyId: ProjectPolicy.PasswordDictionary
+ policyId: ProjectPolicyId.PasswordDictionary
});
console.log(result);
diff --git a/docs/examples/project/get.md b/docs/examples/project/get.md
new file mode 100644
index 00000000..2d4d9f94
--- /dev/null
+++ b/docs/examples/project/get.md
@@ -0,0 +1,13 @@
+```javascript
+import { Client, Project } from "@appwrite.io/console";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const project = new Project(client);
+
+const result = await project.get();
+
+console.log(result);
+```
diff --git a/docs/examples/project/update-auth-method.md b/docs/examples/project/update-auth-method.md
index fc0dfdfd..e92f1245 100644
--- a/docs/examples/project/update-auth-method.md
+++ b/docs/examples/project/update-auth-method.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Project, AuthMethod } from "@appwrite.io/console";
+import { Client, Project, ProjectAuthMethodId } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const client = new Client()
const project = new Project(client);
const result = await project.updateAuthMethod({
- methodId: AuthMethod.EmailPassword,
+ methodId: ProjectAuthMethodId.EmailPassword,
enabled: false
});
diff --git a/docs/examples/project/update-deny-canonical-email-policy.md b/docs/examples/project/update-deny-aliased-email-policy.md
similarity index 83%
rename from docs/examples/project/update-deny-canonical-email-policy.md
rename to docs/examples/project/update-deny-aliased-email-policy.md
index 5b223975..f9a253de 100644
--- a/docs/examples/project/update-deny-canonical-email-policy.md
+++ b/docs/examples/project/update-deny-aliased-email-policy.md
@@ -7,7 +7,7 @@ const client = new Client()
const project = new Project(client);
-const result = await project.updateDenyCanonicalEmailPolicy({
+const result = await project.updateDenyAliasedEmailPolicy({
enabled: false
});
diff --git a/docs/examples/project/update-email-template.md b/docs/examples/project/update-email-template.md
index 2ede3e88..7b2951f9 100644
--- a/docs/examples/project/update-email-template.md
+++ b/docs/examples/project/update-email-template.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Project, EmailTemplateType, EmailTemplateLocale } from "@appwrite.io/console";
+import { Client, Project, ProjectEmailTemplateId, ProjectEmailTemplateLocale } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,8 +8,8 @@ const client = new Client()
const project = new Project(client);
const result = await project.updateEmailTemplate({
- templateId: EmailTemplateType.Verification,
- locale: EmailTemplateLocale.Af, // optional
+ templateId: ProjectEmailTemplateId.Verification,
+ locale: ProjectEmailTemplateLocale.Af, // optional
subject: '', // optional
message: '', // optional
senderName: '', // optional
diff --git a/docs/examples/project/update-key.md b/docs/examples/project/update-key.md
index 3d3282d4..636419e0 100644
--- a/docs/examples/project/update-key.md
+++ b/docs/examples/project/update-key.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Project, Scopes } from "@appwrite.io/console";
+import { Client, Project, ProjectKeyScopes } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -10,7 +10,7 @@ const project = new Project(client);
const result = await project.updateKey({
keyId: '',
name: '',
- scopes: [Scopes.ProjectRead],
+ scopes: [ProjectKeyScopes.ProjectRead],
expire: '2020-10-15T06:38:00.000+00:00' // optional
});
diff --git a/docs/examples/project/update-o-auth-2-google.md b/docs/examples/project/update-o-auth-2-google.md
index b4ecf45f..c84567de 100644
--- a/docs/examples/project/update-o-auth-2-google.md
+++ b/docs/examples/project/update-o-auth-2-google.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Project, Prompt } from "@appwrite.io/console";
+import { Client, Project, ProjectOAuth2GooglePrompt } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -10,7 +10,7 @@ const project = new Project(client);
const result = await project.updateOAuth2Google({
clientId: '', // optional
clientSecret: '', // optional
- prompt: [Prompt.None], // optional
+ prompt: [ProjectOAuth2GooglePrompt.None], // optional
enabled: false // optional
});
diff --git a/docs/examples/project/update-protocol.md b/docs/examples/project/update-protocol.md
index ffdc8e56..e966ad7c 100644
--- a/docs/examples/project/update-protocol.md
+++ b/docs/examples/project/update-protocol.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Project, ProtocolId } from "@appwrite.io/console";
+import { Client, Project, ProjectProtocolId } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const client = new Client()
const project = new Project(client);
const result = await project.updateProtocol({
- protocolId: ProtocolId.Rest,
+ protocolId: ProjectProtocolId.Rest,
enabled: false
});
diff --git a/docs/examples/project/update-service.md b/docs/examples/project/update-service.md
index 460a809f..b3b1ffd3 100644
--- a/docs/examples/project/update-service.md
+++ b/docs/examples/project/update-service.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Project, ServiceId } from "@appwrite.io/console";
+import { Client, Project, ProjectServiceId } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,7 @@ const client = new Client()
const project = new Project(client);
const result = await project.updateService({
- serviceId: ServiceId.Account,
+ serviceId: ProjectServiceId.Account,
enabled: false
});
diff --git a/docs/examples/project/update-smtp.md b/docs/examples/project/update-smtp.md
index 0fefca64..c2236be5 100644
--- a/docs/examples/project/update-smtp.md
+++ b/docs/examples/project/update-smtp.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Project, Secure } from "@appwrite.io/console";
+import { Client, Project, ProjectSMTPSecure } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -16,7 +16,7 @@ const result = await project.updateSMTP({
senderName: '', // optional
replyToEmail: 'email@example.com', // optional
replyToName: '', // optional
- secure: Secure.Tls, // optional
+ secure: ProjectSMTPSecure.Tls, // optional
enabled: false // optional
});
diff --git a/docs/examples/projects/create-schedule.md b/docs/examples/projects/create-schedule.md
index a55d7f0f..52c5e7c6 100644
--- a/docs/examples/projects/create-schedule.md
+++ b/docs/examples/projects/create-schedule.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Projects, ResourceType } from "@appwrite.io/console";
+import { Client, Projects, ScheduleResourceType } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -9,7 +9,7 @@ const projects = new Projects(client);
const result = await projects.createSchedule({
projectId: '',
- resourceType: ResourceType.Function,
+ resourceType: ScheduleResourceType.Function,
resourceId: '',
schedule: '',
active: false, // optional
diff --git a/docs/examples/projects/create.md b/docs/examples/projects/create.md
deleted file mode 100644
index eb8749de..00000000
--- a/docs/examples/projects/create.md
+++ /dev/null
@@ -1,27 +0,0 @@
-```javascript
-import { Client, Projects, Region } from "@appwrite.io/console";
-
-const client = new Client()
- .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
- .setProject(''); // Your project ID
-
-const projects = new Projects(client);
-
-const result = await projects.create({
- projectId: '',
- name: '',
- teamId: '',
- region: Region.Fra, // optional
- description: '', // optional
- logo: '', // optional
- url: 'https://example.com', // optional
- legalName: '', // optional
- legalCountry: '', // optional
- legalState: '', // optional
- legalCity: '', // optional
- legalAddress: '', // optional
- legalTaxId: '' // optional
-});
-
-console.log(result);
-```
diff --git a/docs/examples/projects/update-status.md b/docs/examples/projects/update-status.md
index d795d87e..42345b7c 100644
--- a/docs/examples/projects/update-status.md
+++ b/docs/examples/projects/update-status.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Projects, Status } from "@appwrite.io/console";
+import { Client, Projects, ProjectStatus } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -9,7 +9,7 @@ const projects = new Projects(client);
const result = await projects.updateStatus({
projectId: '',
- status: Status.Active
+ status: ProjectStatus.Active
});
console.log(result);
diff --git a/docs/examples/projects/update.md b/docs/examples/projects/update.md
deleted file mode 100644
index 54004836..00000000
--- a/docs/examples/projects/update.md
+++ /dev/null
@@ -1,25 +0,0 @@
-```javascript
-import { Client, Projects } from "@appwrite.io/console";
-
-const client = new Client()
- .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
- .setProject(''); // Your project ID
-
-const projects = new Projects(client);
-
-const result = await projects.update({
- projectId: '',
- name: '',
- description: '', // optional
- logo: '', // optional
- url: 'https://example.com', // optional
- legalName: '', // optional
- legalCountry: '', // optional
- legalState: '', // optional
- legalCity: '', // optional
- legalAddress: '', // optional
- legalTaxId: '' // optional
-});
-
-console.log(result);
-```
diff --git a/docs/examples/proxy/create-redirect-rule.md b/docs/examples/proxy/create-redirect-rule.md
index 1b8d2f39..0e632cc2 100644
--- a/docs/examples/proxy/create-redirect-rule.md
+++ b/docs/examples/proxy/create-redirect-rule.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Proxy, StatusCode, ProxyResourceType } from "@appwrite.io/console";
+import { Client, Proxy, RedirectStatusCode, ProxyResourceType } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -10,7 +10,7 @@ const proxy = new Proxy(client);
const result = await proxy.createRedirectRule({
domain: '',
url: 'https://example.com',
- statusCode: StatusCode.MovedPermanently301,
+ statusCode: RedirectStatusCode.MovedPermanently,
resourceId: '',
resourceType: ProxyResourceType.Site
});
diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md
index a86709e8..8a4f1595 100644
--- a/docs/examples/sites/create.md
+++ b/docs/examples/sites/create.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Sites, Framework, BuildRuntime, Adapter } from "@appwrite.io/console";
+import { Client, Sites, SiteFramework, SiteBuildRuntime, SiteAdapter } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -10,8 +10,8 @@ const sites = new Sites(client);
const result = await sites.create({
siteId: '',
name: '',
- framework: Framework.Analog,
- buildRuntime: BuildRuntime.Node145,
+ framework: SiteFramework.Analog,
+ buildRuntime: SiteBuildRuntime.Node145,
enabled: false, // optional
logging: false, // optional
timeout: 1, // optional
@@ -19,13 +19,15 @@ const result = await sites.create({
buildCommand: '', // optional
startCommand: '', // optional
outputDirectory: '', // optional
- adapter: Adapter.Static, // optional
+ adapter: SiteAdapter.Static, // optional
installationId: '', // optional
fallbackFile: '', // optional
providerRepositoryId: '', // optional
providerBranch: '', // optional
providerSilentMode: false, // optional
providerRootDirectory: '', // optional
+ providerBranches: [], // optional
+ providerPaths: [], // optional
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 0 // optional
diff --git a/docs/examples/sites/list-templates.md b/docs/examples/sites/list-templates.md
index f427bd25..50b56240 100644
--- a/docs/examples/sites/list-templates.md
+++ b/docs/examples/sites/list-templates.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Sites, Frameworks, UseCases } from "@appwrite.io/console";
+import { Client, Sites, SiteFramework, SiteTemplateUseCase } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,8 +8,8 @@ const client = new Client()
const sites = new Sites(client);
const result = await sites.listTemplates({
- frameworks: [Frameworks.Analog], // optional
- useCases: [UseCases.Portfolio], // optional
+ frameworks: [SiteFramework.Analog], // optional
+ useCases: [SiteTemplateUseCase.Portfolio], // optional
limit: 1, // optional
offset: 0 // optional
});
diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md
index 731ae4b9..47f2f7ae 100644
--- a/docs/examples/sites/update.md
+++ b/docs/examples/sites/update.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, Sites, Framework, BuildRuntime, Adapter } from "@appwrite.io/console";
+import { Client, Sites, SiteFramework, SiteBuildRuntime, SiteAdapter } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -10,7 +10,7 @@ const sites = new Sites(client);
const result = await sites.update({
siteId: '',
name: '',
- framework: Framework.Analog,
+ framework: SiteFramework.Analog,
enabled: false, // optional
logging: false, // optional
timeout: 1, // optional
@@ -18,14 +18,16 @@ const result = await sites.update({
buildCommand: '', // optional
startCommand: '', // optional
outputDirectory: '', // optional
- buildRuntime: BuildRuntime.Node145, // optional
- adapter: Adapter.Static, // optional
+ buildRuntime: SiteBuildRuntime.Node145, // optional
+ adapter: SiteAdapter.Static, // optional
fallbackFile: '', // optional
installationId: '', // optional
providerRepositoryId: '', // optional
providerBranch: '', // optional
providerSilentMode: false, // optional
providerRootDirectory: '', // optional
+ providerBranches: [], // optional
+ providerPaths: [], // optional
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 0 // optional
diff --git a/docs/examples/usage/list-events.md b/docs/examples/usage/list-events.md
new file mode 100644
index 00000000..c8767f08
--- /dev/null
+++ b/docs/examples/usage/list-events.md
@@ -0,0 +1,16 @@
+```javascript
+import { Client, Usage } from "@appwrite.io/console";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const usage = new Usage(client);
+
+const result = await usage.listEvents({
+ queries: [], // optional
+ total: false // optional
+});
+
+console.log(result);
+```
diff --git a/docs/examples/usage/list-gauges.md b/docs/examples/usage/list-gauges.md
new file mode 100644
index 00000000..fe14dc55
--- /dev/null
+++ b/docs/examples/usage/list-gauges.md
@@ -0,0 +1,16 @@
+```javascript
+import { Client, Usage } from "@appwrite.io/console";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const usage = new Usage(client);
+
+const result = await usage.listGauges({
+ queries: [], // optional
+ total: false // optional
+});
+
+console.log(result);
+```
diff --git a/docs/examples/users/get-usage.md b/docs/examples/users/get-usage.md
index 53d11dec..b998877b 100644
--- a/docs/examples/users/get-usage.md
+++ b/docs/examples/users/get-usage.md
@@ -8,7 +8,7 @@ const client = new Client()
const users = new Users(client);
const result = await users.getUsage({
- range: UsageRange.TwentyFourHours // optional
+ range: UsageRange.24h // optional
});
console.log(result);
diff --git a/docs/examples/vectorsdb/create-text-embeddings.md b/docs/examples/vectorsdb/create-text-embeddings.md
index e024b563..01654bc4 100644
--- a/docs/examples/vectorsdb/create-text-embeddings.md
+++ b/docs/examples/vectorsdb/create-text-embeddings.md
@@ -1,5 +1,5 @@
```javascript
-import { Client, VectorsDB, Model } from "@appwrite.io/console";
+import { Client, VectorsDB, EmbeddingModel } from "@appwrite.io/console";
const client = new Client()
.setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
@@ -9,7 +9,7 @@ const vectorsDB = new VectorsDB(client);
const result = await vectorsDB.createTextEmbeddings({
texts: [],
- model: Model.Embeddinggemma // optional
+ model: EmbeddingModel.Embeddinggemma // optional
});
console.log(result);
diff --git a/docs/examples/vectorsdb/list.md b/docs/examples/vectorsdb/list.md
index e7649d01..d09c6f98 100644
--- a/docs/examples/vectorsdb/list.md
+++ b/docs/examples/vectorsdb/list.md
@@ -9,7 +9,6 @@ const vectorsDB = new VectorsDB(client);
const result = await vectorsDB.list({
queries: [], // optional
- search: '', // optional
total: false // optional
});
diff --git a/package-lock.json b/package-lock.json
index 685364d8..bbeff03c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@appwrite.io/console",
- "version": "13.0.0",
+ "version": "13.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@appwrite.io/console",
- "version": "13.0.0",
+ "version": "13.1.0",
"license": "BSD-3-Clause",
"dependencies": {
"json-bigint": "1.0.0"
diff --git a/package.json b/package.json
index 93313761..17c9e470 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "@appwrite.io/console",
"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": "13.0.0",
+ "version": "13.1.0",
"license": "BSD-3-Clause",
"main": "dist/cjs/sdk.js",
"exports": {
diff --git a/src/channel.ts b/src/channel.ts
index a5d7ee38..d4618a36 100644
--- a/src/channel.ts
+++ b/src/channel.ts
@@ -11,9 +11,10 @@ interface Func { _fn: any }
interface Execution { _exec: any }
interface Team { _team: any }
interface Membership { _mem: any }
+interface Presence { _presence: any }
interface Resolved { _res: any }
-type Actionable = Document | Row | File | Team | Membership;
+type Actionable = Document | Row | File | Team | Membership | Presence;
function normalize(id: string): string {
if (id === undefined || id === null) {
@@ -82,7 +83,7 @@ export class Channel {
return this.resolve("create");
}
- upsert(this: Channel): Channel {
+ upsert(this: Channel): Channel {
return this.resolve("upsert");
}
@@ -123,6 +124,10 @@ export class Channel {
return new Channel(["memberships", normalize(id)]);
}
+ static presence(id: string) {
+ return new Channel(["presences", normalize(id)]);
+ }
+
static account(): string {
return "account";
}
@@ -151,8 +156,12 @@ export class Channel {
static memberships(): string {
return "memberships";
}
+
+ static presences(): string {
+ return "presences";
+ }
}
// Export types for backward compatibility with realtime
-export type ActionableChannel = Channel | Channel | Channel | Channel | Channel | Channel;
+export type ActionableChannel = Channel | Channel | Channel | Channel | Channel | Channel | Channel;
export type ResolvedChannel = Channel;
diff --git a/src/client.ts b/src/client.ts
index 8db723f2..69b7e60f 100644
--- a/src/client.ts
+++ b/src/client.ts
@@ -390,8 +390,8 @@ class Client {
'x-sdk-name': 'Console',
'x-sdk-platform': 'console',
'x-sdk-language': 'web',
- 'x-sdk-version': '13.0.0',
- 'X-Appwrite-Response-Format': '1.9.4',
+ 'x-sdk-version': '13.1.0',
+ 'X-Appwrite-Response-Format': '1.9.5',
};
/**
@@ -978,44 +978,131 @@ class Client {
return await this.call(method, url, headers, originalPayload);
}
- let start = 0;
- let response = null;
+ const totalChunks = Math.ceil(file.size / Client.CHUNK_SIZE);
+
+ // Upload first chunk alone to get the upload ID
+ const firstChunkEnd = Math.min(Client.CHUNK_SIZE, file.size);
+ const firstChunkHeaders = { ...headers, 'content-range': `bytes 0-${firstChunkEnd - 1}/${file.size}` };
+ const firstChunk = file.slice(0, firstChunkEnd);
+ const firstPayload = { ...originalPayload };
+ firstPayload[fileParam] = new File([firstChunk], file.name);
+
+ let response = await this.call(method, url, firstChunkHeaders, firstPayload);
+ const uploadId = response?.$id;
+
+ if (onProgress && typeof onProgress === 'function') {
+ onProgress({
+ $id: uploadId,
+ progress: Math.round((firstChunkEnd / file.size) * 100),
+ sizeUploaded: firstChunkEnd,
+ chunksTotal: totalChunks,
+ chunksUploaded: 1
+ });
+ }
- while (start < file.size) {
- let end = start + Client.CHUNK_SIZE; // Prepare end for the next chunk
- if (end >= file.size) {
- end = file.size; // Adjust for the last chunk to include the last byte
- }
+ if (totalChunks === 1) {
+ return response;
+ }
- headers['content-range'] = `bytes ${start}-${end-1}/${file.size}`;
- const chunk = file.slice(start, end);
+ // Prepare remaining chunks
+ const chunks: { start: number; end: number }[] = [];
+ for (let i = 1; i < totalChunks; i++) {
+ const start = i * Client.CHUNK_SIZE;
+ const end = Math.min(start + Client.CHUNK_SIZE, file.size);
+ chunks.push({ start, end });
+ }
- let payload = { ...originalPayload };
- payload[fileParam] = new File([chunk], file.name);
+ // Upload remaining chunks with max concurrency of 8
+ const CONCURRENCY = 8;
+ let completedCount = 1;
+ let uploadedBytes = firstChunkEnd;
+ let lastResponse = response;
+ let finalResponse = null;
+ let rejected = false;
+
+ const isUploadComplete = (chunkResponse: any) => {
+ const chunksUploaded = chunkResponse?.chunksUploaded;
+ const chunksTotal = chunkResponse?.chunksTotal ?? totalChunks;
+ return typeof chunksUploaded === 'number' && typeof chunksTotal === 'number' && chunksUploaded >= chunksTotal;
+ };
- response = await this.call(method, url, headers, payload);
+ const uploadChunk = async (chunk: typeof chunks[0]) => {
+ const chunkHeaders = { ...headers };
+ if (uploadId) {
+ chunkHeaders['x-appwrite-id'] = uploadId;
+ }
+ chunkHeaders['content-range'] = `bytes ${chunk.start}-${chunk.end - 1}/${file.size}`;
+
+ const chunkBlob = file.slice(chunk.start, chunk.end);
+ const chunkPayload = { ...originalPayload };
+ chunkPayload[fileParam] = new File([chunkBlob], file.name);
+
+ const chunkResponse = await this.call(method, url, chunkHeaders, chunkPayload);
+
+ if (rejected) {
+ return chunkResponse;
+ }
+
+ completedCount++;
+ uploadedBytes += (chunk.end - chunk.start);
+
+ lastResponse = chunkResponse;
+ if (isUploadComplete(chunkResponse)) {
+ finalResponse = chunkResponse;
+ }
if (onProgress && typeof onProgress === 'function') {
onProgress({
- $id: response.$id,
- progress: Math.round((end / file.size) * 100),
- sizeUploaded: end,
- chunksTotal: Math.ceil(file.size / Client.CHUNK_SIZE),
- chunksUploaded: Math.ceil(end / Client.CHUNK_SIZE)
+ $id: uploadId,
+ progress: Math.round((uploadedBytes / file.size) * 100),
+ sizeUploaded: uploadedBytes,
+ chunksTotal: totalChunks,
+ chunksUploaded: completedCount
});
}
- if (response && response.$id) {
- headers['x-appwrite-id'] = response.$id;
- }
+ return chunkResponse;
+ };
- start = end;
- }
+ await new Promise((resolve, reject) => {
+ let nextChunk = 0;
+ let inFlight = 0;
+ let completed = 0;
+
+ const uploadNext = () => {
+ if (rejected) {
+ return;
+ }
+
+ if (completed === chunks.length) {
+ resolve();
+ return;
+ }
+
+ while (inFlight < CONCURRENCY && nextChunk < chunks.length) {
+ const chunk = chunks[nextChunk++];
+ inFlight++;
+
+ uploadChunk(chunk)
+ .then(() => {
+ inFlight--;
+ completed++;
+ uploadNext();
+ })
+ .catch((error) => {
+ rejected = true;
+ reject(error);
+ });
+ }
+ };
- return response;
+ uploadNext();
+ });
+
+ return finalResponse ?? lastResponse;
}
- async ping(): Promise {
+ async ping(): Promise {
return this.call('GET', new URL(this.config.endpoint + '/ping'));
}
@@ -1069,7 +1156,12 @@ class Client {
}
if (data && typeof data === 'object') {
- data.toString = () => JSONbig.stringify(data);
+ Object.defineProperty(data, 'toString', {
+ value: () => JSONbig.stringify(data),
+ writable: true,
+ enumerable: false,
+ configurable: true,
+ });
}
return data;
diff --git a/src/enums/account-key-scopes.ts b/src/enums/account-key-scopes.ts
new file mode 100644
index 00000000..ef159baf
--- /dev/null
+++ b/src/enums/account-key-scopes.ts
@@ -0,0 +1,5 @@
+export enum AccountKeyScopes {
+ Account = 'account',
+ TeamsRead = 'teams.read',
+ TeamsWrite = 'teams.write',
+}
\ No newline at end of file
diff --git a/src/enums/addon.ts b/src/enums/addon.ts
deleted file mode 100644
index 60752f75..00000000
--- a/src/enums/addon.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export enum Addon {
- Baa = 'baa',
-}
\ No newline at end of file
diff --git a/src/enums/appwrite-migration-resource.ts b/src/enums/appwrite-migration-resource.ts
index 71acb705..c8dee275 100644
--- a/src/enums/appwrite-migration-resource.ts
+++ b/src/enums/appwrite-migration-resource.ts
@@ -24,5 +24,6 @@ export enum AppwriteMigrationResource {
Site = 'site',
Sitedeployment = 'site-deployment',
Sitevariable = 'site-variable',
+ Platform = 'platform',
Backuppolicy = 'backup-policy',
}
\ No newline at end of file
diff --git a/src/enums/backup-services.ts b/src/enums/backup-services.ts
index bd0582ce..adef40d2 100644
--- a/src/enums/backup-services.ts
+++ b/src/enums/backup-services.ts
@@ -3,6 +3,7 @@ export enum BackupServices {
Tablesdb = 'tablesdb',
Documentsdb = 'documentsdb',
Vectorsdb = 'vectorsdb',
+ DedicatedDatabases = 'dedicatedDatabases',
Functions = 'functions',
Storage = 'storage',
}
\ No newline at end of file
diff --git a/src/enums/resource-type.ts b/src/enums/block-resource-type.ts
similarity index 65%
rename from src/enums/resource-type.ts
rename to src/enums/block-resource-type.ts
index b1f8e6d7..1db8a7cc 100644
--- a/src/enums/resource-type.ts
+++ b/src/enums/block-resource-type.ts
@@ -1,4 +1,4 @@
-export enum ResourceType {
+export enum BlockResourceType {
Projects = 'projects',
Functions = 'functions',
Sites = 'sites',
@@ -8,8 +8,4 @@ export enum ResourceType {
Topics = 'topics',
Subscribers = 'subscribers',
Messages = 'messages',
- Function = 'function',
- Execution = 'execution',
- Message = 'message',
- Backup = 'backup',
}
\ No newline at end of file
diff --git a/src/enums/theme.ts b/src/enums/browser-theme.ts
similarity index 60%
rename from src/enums/theme.ts
rename to src/enums/browser-theme.ts
index 5e823a9b..9f8c382a 100644
--- a/src/enums/theme.ts
+++ b/src/enums/browser-theme.ts
@@ -1,4 +1,4 @@
-export enum Theme {
+export enum BrowserTheme {
Light = 'light',
Dark = 'dark',
}
\ No newline at end of file
diff --git a/src/enums/cache-database.ts b/src/enums/cache-database.ts
new file mode 100644
index 00000000..47a06a6b
--- /dev/null
+++ b/src/enums/cache-database.ts
@@ -0,0 +1,5 @@
+export enum CacheDatabase {
+ Console = 'console',
+ Project = 'project',
+ Logs = 'logs',
+}
\ No newline at end of file
diff --git a/src/enums/cache-target.ts b/src/enums/cache-target.ts
new file mode 100644
index 00000000..b6d74b56
--- /dev/null
+++ b/src/enums/cache-target.ts
@@ -0,0 +1,8 @@
+export enum CacheTarget {
+ Cache = 'cache',
+ Timelimit = 'timelimit',
+ Locks = 'locks',
+ Pubsub = 'pubsub',
+ Queue = 'queue',
+ All = 'all',
+}
\ No newline at end of file
diff --git a/src/enums/registration-type.ts b/src/enums/domain-registration-type.ts
similarity index 71%
rename from src/enums/registration-type.ts
rename to src/enums/domain-registration-type.ts
index a4020695..9e0e10b0 100644
--- a/src/enums/registration-type.ts
+++ b/src/enums/domain-registration-type.ts
@@ -1,4 +1,4 @@
-export enum RegistrationType {
+export enum DomainRegistrationType {
New = 'new',
Transfer = 'transfer',
Renewal = 'renewal',
diff --git a/src/enums/filter-type.ts b/src/enums/domain-suggestion-type.ts
similarity index 61%
rename from src/enums/filter-type.ts
rename to src/enums/domain-suggestion-type.ts
index b95b6bc0..d2eca6eb 100644
--- a/src/enums/filter-type.ts
+++ b/src/enums/domain-suggestion-type.ts
@@ -1,4 +1,4 @@
-export enum FilterType {
+export enum DomainSuggestionType {
Premium = 'premium',
Suggestion = 'suggestion',
}
\ No newline at end of file
diff --git a/src/enums/model.ts b/src/enums/embedding-model.ts
similarity index 57%
rename from src/enums/model.ts
rename to src/enums/embedding-model.ts
index 78e605e3..cfdbeef1 100644
--- a/src/enums/model.ts
+++ b/src/enums/embedding-model.ts
@@ -1,3 +1,3 @@
-export enum Model {
+export enum EmbeddingModel {
Embeddinggemma = 'embeddinggemma',
}
\ No newline at end of file
diff --git a/src/enums/frameworks.ts b/src/enums/frameworks.ts
deleted file mode 100644
index 6be80af0..00000000
--- a/src/enums/frameworks.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-export enum Frameworks {
- Analog = 'analog',
- Angular = 'angular',
- Nextjs = 'nextjs',
- React = 'react',
- Nuxt = 'nuxt',
- Vue = 'vue',
- Sveltekit = 'sveltekit',
- Astro = 'astro',
- Tanstackstart = 'tanstack-start',
- Remix = 'remix',
- Lynx = 'lynx',
- Flutter = 'flutter',
- Reactnative = 'react-native',
- Vite = 'vite',
- Other = 'other',
-}
\ No newline at end of file
diff --git a/src/enums/build-runtime.ts b/src/enums/function-runtime.ts
similarity index 96%
rename from src/enums/build-runtime.ts
rename to src/enums/function-runtime.ts
index 1466d635..b80690d8 100644
--- a/src/enums/build-runtime.ts
+++ b/src/enums/function-runtime.ts
@@ -1,4 +1,4 @@
-export enum BuildRuntime {
+export enum FunctionRuntime {
Node145 = 'node-14.5',
Node160 = 'node-16.0',
Node180 = 'node-18.0',
@@ -48,6 +48,7 @@ export enum BuildRuntime {
Dart39 = 'dart-3.9',
Dart310 = 'dart-3.10',
Dart311 = 'dart-3.11',
+ Dart312 = 'dart-3.12',
Dotnet60 = 'dotnet-6.0',
Dotnet70 = 'dotnet-7.0',
Dotnet80 = 'dotnet-8.0',
@@ -88,4 +89,5 @@ export enum BuildRuntime {
Flutter335 = 'flutter-3.35',
Flutter338 = 'flutter-3.38',
Flutter341 = 'flutter-3.41',
+ Flutter344 = 'flutter-3.44',
}
\ No newline at end of file
diff --git a/src/enums/function-template-use-case.ts b/src/enums/function-template-use-case.ts
new file mode 100644
index 00000000..e1c25508
--- /dev/null
+++ b/src/enums/function-template-use-case.ts
@@ -0,0 +1,9 @@
+export enum FunctionTemplateUseCase {
+ Starter = 'starter',
+ Databases = 'databases',
+ Ai = 'ai',
+ Messaging = 'messaging',
+ Utilities = 'utilities',
+ Devtools = 'dev-tools',
+ Auth = 'auth',
+}
\ No newline at end of file
diff --git a/src/enums/name.ts b/src/enums/health-queue-name.ts
similarity index 93%
rename from src/enums/name.ts
rename to src/enums/health-queue-name.ts
index 8cd297bc..81320f8d 100644
--- a/src/enums/name.ts
+++ b/src/enums/health-queue-name.ts
@@ -1,4 +1,4 @@
-export enum Name {
+export enum HealthQueueName {
V1database = 'v1-database',
V1deletes = 'v1-deletes',
V1audits = 'v1-audits',
diff --git a/src/enums/on-duplicate.ts b/src/enums/migration-on-duplicate.ts
similarity index 66%
rename from src/enums/on-duplicate.ts
rename to src/enums/migration-on-duplicate.ts
index 9ab3dc85..8b5b9b89 100644
--- a/src/enums/on-duplicate.ts
+++ b/src/enums/migration-on-duplicate.ts
@@ -1,4 +1,4 @@
-export enum OnDuplicate {
+export enum MigrationOnDuplicate {
Fail = 'fail',
Skip = 'skip',
Overwrite = 'overwrite',
diff --git a/src/enums/o-auth-provider.ts b/src/enums/o-auth-provider.ts
index 06189633..cc9e340b 100644
--- a/src/enums/o-auth-provider.ts
+++ b/src/enums/o-auth-provider.ts
@@ -42,6 +42,4 @@ export enum OAuthProvider {
Yandex = 'yandex',
Zoho = 'zoho',
Zoom = 'zoom',
- GithubImagine = 'githubImagine',
- GoogleImagine = 'googleImagine',
}
\ No newline at end of file
diff --git a/src/enums/organization-addon.ts b/src/enums/organization-addon.ts
new file mode 100644
index 00000000..ff5b7aab
--- /dev/null
+++ b/src/enums/organization-addon.ts
@@ -0,0 +1,4 @@
+export enum OrganizationAddon {
+ Baa = 'baa',
+ BackupRecovery = 'backup_recovery',
+}
\ No newline at end of file
diff --git a/src/enums/organization-key-scopes.ts b/src/enums/organization-key-scopes.ts
new file mode 100644
index 00000000..05c96d22
--- /dev/null
+++ b/src/enums/organization-key-scopes.ts
@@ -0,0 +1,12 @@
+export enum OrganizationKeyScopes {
+ ProjectsRead = 'projects.read',
+ ProjectsWrite = 'projects.write',
+ DevKeysRead = 'devKeys.read',
+ DevKeysWrite = 'devKeys.write',
+ OrganizationKeysRead = 'organization.keys.read',
+ OrganizationKeysWrite = 'organization.keys.write',
+ DomainsRead = 'domains.read',
+ DomainsWrite = 'domains.write',
+ KeysRead = 'keys.read',
+ KeysWrite = 'keys.write',
+}
\ No newline at end of file
diff --git a/src/enums/auth-method.ts b/src/enums/project-auth-method-id.ts
similarity index 84%
rename from src/enums/auth-method.ts
rename to src/enums/project-auth-method-id.ts
index d5800ad9..a05c217e 100644
--- a/src/enums/auth-method.ts
+++ b/src/enums/project-auth-method-id.ts
@@ -1,4 +1,4 @@
-export enum AuthMethod {
+export enum ProjectAuthMethodId {
Emailpassword = 'email-password',
Magicurl = 'magic-url',
Emailotp = 'email-otp',
diff --git a/src/enums/email-template-type.ts b/src/enums/project-email-template-id.ts
similarity index 86%
rename from src/enums/email-template-type.ts
rename to src/enums/project-email-template-id.ts
index 2a561bf0..b5aba1a6 100644
--- a/src/enums/email-template-type.ts
+++ b/src/enums/project-email-template-id.ts
@@ -1,4 +1,4 @@
-export enum EmailTemplateType {
+export enum ProjectEmailTemplateId {
Verification = 'verification',
MagicSession = 'magicSession',
Recovery = 'recovery',
diff --git a/src/enums/email-template-locale.ts b/src/enums/project-email-template-locale.ts
similarity index 98%
rename from src/enums/email-template-locale.ts
rename to src/enums/project-email-template-locale.ts
index 82656b89..b5bb7cf8 100644
--- a/src/enums/email-template-locale.ts
+++ b/src/enums/project-email-template-locale.ts
@@ -1,4 +1,4 @@
-export enum EmailTemplateLocale {
+export enum ProjectEmailTemplateLocale {
Af = 'af',
Arae = 'ar-ae',
Arbh = 'ar-bh',
diff --git a/src/enums/scopes.ts b/src/enums/project-key-scopes.ts
similarity index 91%
rename from src/enums/scopes.ts
rename to src/enums/project-key-scopes.ts
index 532eb75c..fe019965 100644
--- a/src/enums/scopes.ts
+++ b/src/enums/project-key-scopes.ts
@@ -1,7 +1,4 @@
-export enum Scopes {
- Account = 'account',
- TeamsRead = 'teams.read',
- TeamsWrite = 'teams.write',
+export enum ProjectKeyScopes {
ProjectRead = 'project.read',
ProjectWrite = 'project.write',
KeysRead = 'keys.read',
@@ -22,6 +19,8 @@ export enum Scopes {
UsersWrite = 'users.write',
SessionsRead = 'sessions.read',
SessionsWrite = 'sessions.write',
+ TeamsRead = 'teams.read',
+ TeamsWrite = 'teams.write',
DatabasesRead = 'databases.read',
DatabasesWrite = 'databases.write',
TablesRead = 'tables.read',
@@ -78,6 +77,12 @@ export enum Scopes {
SchedulesWrite = 'schedules.write',
VcsRead = 'vcs.read',
VcsWrite = 'vcs.write',
+ InsightsRead = 'insights.read',
+ InsightsWrite = 'insights.write',
+ ReportsRead = 'reports.read',
+ ReportsWrite = 'reports.write',
+ PresencesRead = 'presences.read',
+ PresencesWrite = 'presences.write',
BackupsPoliciesRead = 'backups.policies.read',
BackupsPoliciesWrite = 'backups.policies.write',
ArchivesRead = 'archives.read',
@@ -87,8 +92,5 @@ export enum Scopes {
DomainsRead = 'domains.read',
DomainsWrite = 'domains.write',
EventsRead = 'events.read',
- ProjectsRead = 'projects.read',
- ProjectsWrite = 'projects.write',
- DevKeysRead = 'devKeys.read',
- DevKeysWrite = 'devKeys.write',
+ UsageRead = 'usage.read',
}
\ No newline at end of file
diff --git a/src/enums/prompt.ts b/src/enums/project-o-auth-2-google-prompt.ts
similarity index 67%
rename from src/enums/prompt.ts
rename to src/enums/project-o-auth-2-google-prompt.ts
index 9bb101fa..75db98ec 100644
--- a/src/enums/prompt.ts
+++ b/src/enums/project-o-auth-2-google-prompt.ts
@@ -1,4 +1,4 @@
-export enum Prompt {
+export enum ProjectOAuth2GooglePrompt {
None = 'none',
Consent = 'consent',
SelectAccount = 'select_account',
diff --git a/src/enums/project-o-auth-provider-id.ts b/src/enums/project-o-auth-provider-id.ts
new file mode 100644
index 00000000..e1ed1b85
--- /dev/null
+++ b/src/enums/project-o-auth-provider-id.ts
@@ -0,0 +1,45 @@
+export enum ProjectOAuthProviderId {
+ Amazon = 'amazon',
+ Apple = 'apple',
+ Auth0 = 'auth0',
+ Authentik = 'authentik',
+ Autodesk = 'autodesk',
+ Bitbucket = 'bitbucket',
+ Bitly = 'bitly',
+ Box = 'box',
+ Dailymotion = 'dailymotion',
+ Discord = 'discord',
+ Disqus = 'disqus',
+ Dropbox = 'dropbox',
+ Etsy = 'etsy',
+ Facebook = 'facebook',
+ Figma = 'figma',
+ Fusionauth = 'fusionauth',
+ Github = 'github',
+ Gitlab = 'gitlab',
+ Google = 'google',
+ Keycloak = 'keycloak',
+ Kick = 'kick',
+ Linkedin = 'linkedin',
+ Microsoft = 'microsoft',
+ Notion = 'notion',
+ Oidc = 'oidc',
+ Okta = 'okta',
+ Paypal = 'paypal',
+ PaypalSandbox = 'paypalSandbox',
+ Podio = 'podio',
+ Salesforce = 'salesforce',
+ Slack = 'slack',
+ Spotify = 'spotify',
+ Stripe = 'stripe',
+ Tradeshift = 'tradeshift',
+ TradeshiftBox = 'tradeshiftBox',
+ Twitch = 'twitch',
+ Wordpress = 'wordpress',
+ X = 'x',
+ Yahoo = 'yahoo',
+ Yammer = 'yammer',
+ Yandex = 'yandex',
+ Zoho = 'zoho',
+ Zoom = 'zoom',
+}
\ No newline at end of file
diff --git a/src/enums/project-policy.ts b/src/enums/project-policy-id.ts
similarity index 92%
rename from src/enums/project-policy.ts
rename to src/enums/project-policy-id.ts
index d52bf99a..2031ce9b 100644
--- a/src/enums/project-policy.ts
+++ b/src/enums/project-policy-id.ts
@@ -1,4 +1,4 @@
-export enum ProjectPolicy {
+export enum ProjectPolicyId {
Passworddictionary = 'password-dictionary',
Passwordhistory = 'password-history',
Passwordpersonaldata = 'password-personal-data',
diff --git a/src/enums/protocol-id.ts b/src/enums/project-protocol-id.ts
similarity index 69%
rename from src/enums/protocol-id.ts
rename to src/enums/project-protocol-id.ts
index 94d9095f..10a89c21 100644
--- a/src/enums/protocol-id.ts
+++ b/src/enums/project-protocol-id.ts
@@ -1,4 +1,4 @@
-export enum ProtocolId {
+export enum ProjectProtocolId {
Rest = 'rest',
Graphql = 'graphql',
Websocket = 'websocket',
diff --git a/src/enums/service-id.ts b/src/enums/project-service-id.ts
similarity index 88%
rename from src/enums/service-id.ts
rename to src/enums/project-service-id.ts
index 29281124..01f844a8 100644
--- a/src/enums/service-id.ts
+++ b/src/enums/project-service-id.ts
@@ -1,4 +1,4 @@
-export enum ServiceId {
+export enum ProjectServiceId {
Account = 'account',
Avatars = 'avatars',
Databases = 'databases',
@@ -16,4 +16,5 @@ export enum ServiceId {
Graphql = 'graphql',
Migrations = 'migrations',
Messaging = 'messaging',
+ Advisor = 'advisor',
}
\ No newline at end of file
diff --git a/src/enums/secure.ts b/src/enums/project-smtp-secure.ts
similarity index 52%
rename from src/enums/secure.ts
rename to src/enums/project-smtp-secure.ts
index 0ab54cf8..d3d37687 100644
--- a/src/enums/secure.ts
+++ b/src/enums/project-smtp-secure.ts
@@ -1,4 +1,4 @@
-export enum Secure {
+export enum ProjectSMTPSecure {
Tls = 'tls',
Ssl = 'ssl',
}
\ No newline at end of file
diff --git a/src/enums/project-status.ts b/src/enums/project-status.ts
new file mode 100644
index 00000000..65720b43
--- /dev/null
+++ b/src/enums/project-status.ts
@@ -0,0 +1,3 @@
+export enum ProjectStatus {
+ Active = 'active',
+}
\ No newline at end of file
diff --git a/src/enums/query-suggestion-resource.ts b/src/enums/query-suggestion-resource.ts
index 5663198a..a17f2788 100644
--- a/src/enums/query-suggestion-resource.ts
+++ b/src/enums/query-suggestion-resource.ts
@@ -27,6 +27,8 @@ export enum QuerySuggestionResource {
Repositories = 'repositories',
VcsComments = 'vcscomments',
VcsCommentLocks = 'vcscommentlocks',
+ Reports = 'reports',
+ Insights = 'insights',
Users = 'users',
Cache = 'cache',
Tokens = 'tokens',
@@ -41,6 +43,7 @@ export enum QuerySuggestionResource {
Topics = 'topics',
Subscribers = 'subscribers',
Targets = 'targets',
+ PresenceLogs = 'presencelogs',
Companies = 'companies',
BillingAddresses = 'billingaddresses',
BillingAggregations = 'billingaggregations',
@@ -71,4 +74,10 @@ export enum QuerySuggestionResource {
Transactions = 'transactions',
TransactionLogs = 'transactionlogs',
Stats = 'stats',
+ DedicatedDatabases = 'dedicateddatabases',
+ DedicatedDatabaseConfigs = 'dedicateddatabaseconfigs',
+ DedicatedDatabaseRuntimes = 'dedicateddatabaseruntimes',
+ DedicatedDatabaseOperations = 'dedicateddatabaseoperations',
+ DedicatedDatabaseBackups = 'dedicateddatabasebackups',
+ DedicatedDatabaseRestorations = 'dedicateddatabaserestorations',
}
\ No newline at end of file
diff --git a/src/enums/redirect-status-code.ts b/src/enums/redirect-status-code.ts
new file mode 100644
index 00000000..63580669
--- /dev/null
+++ b/src/enums/redirect-status-code.ts
@@ -0,0 +1,6 @@
+export enum RedirectStatusCode {
+ MovedPermanently = '301',
+ Found = '302',
+ TemporaryRedirect = '307',
+ PermanentRedirect = '308',
+}
\ No newline at end of file
diff --git a/src/enums/runtimes.ts b/src/enums/runtimes.ts
deleted file mode 100644
index 22ed5856..00000000
--- a/src/enums/runtimes.ts
+++ /dev/null
@@ -1,91 +0,0 @@
-export enum Runtimes {
- Node145 = 'node-14.5',
- Node160 = 'node-16.0',
- Node180 = 'node-18.0',
- Node190 = 'node-19.0',
- Node200 = 'node-20.0',
- Node210 = 'node-21.0',
- Node22 = 'node-22',
- Node23 = 'node-23',
- Node24 = 'node-24',
- Node25 = 'node-25',
- Php80 = 'php-8.0',
- Php81 = 'php-8.1',
- Php82 = 'php-8.2',
- Php83 = 'php-8.3',
- Php84 = 'php-8.4',
- Ruby30 = 'ruby-3.0',
- Ruby31 = 'ruby-3.1',
- Ruby32 = 'ruby-3.2',
- Ruby33 = 'ruby-3.3',
- Ruby34 = 'ruby-3.4',
- Ruby40 = 'ruby-4.0',
- Python38 = 'python-3.8',
- Python39 = 'python-3.9',
- Python310 = 'python-3.10',
- Python311 = 'python-3.11',
- Python312 = 'python-3.12',
- Python313 = 'python-3.13',
- Python314 = 'python-3.14',
- Pythonml311 = 'python-ml-3.11',
- Pythonml312 = 'python-ml-3.12',
- Pythonml313 = 'python-ml-3.13',
- Deno140 = 'deno-1.40',
- Deno146 = 'deno-1.46',
- Deno20 = 'deno-2.0',
- Deno25 = 'deno-2.5',
- Deno26 = 'deno-2.6',
- Dart215 = 'dart-2.15',
- Dart216 = 'dart-2.16',
- Dart217 = 'dart-2.17',
- Dart218 = 'dart-2.18',
- Dart219 = 'dart-2.19',
- Dart30 = 'dart-3.0',
- Dart31 = 'dart-3.1',
- Dart33 = 'dart-3.3',
- Dart35 = 'dart-3.5',
- Dart38 = 'dart-3.8',
- Dart39 = 'dart-3.9',
- Dart310 = 'dart-3.10',
- Dart311 = 'dart-3.11',
- Dotnet60 = 'dotnet-6.0',
- Dotnet70 = 'dotnet-7.0',
- Dotnet80 = 'dotnet-8.0',
- Dotnet10 = 'dotnet-10',
- Java80 = 'java-8.0',
- Java110 = 'java-11.0',
- Java170 = 'java-17.0',
- Java180 = 'java-18.0',
- Java210 = 'java-21.0',
- Java22 = 'java-22',
- Java25 = 'java-25',
- Swift55 = 'swift-5.5',
- Swift58 = 'swift-5.8',
- Swift59 = 'swift-5.9',
- Swift510 = 'swift-5.10',
- Swift62 = 'swift-6.2',
- Kotlin16 = 'kotlin-1.6',
- Kotlin18 = 'kotlin-1.8',
- Kotlin19 = 'kotlin-1.9',
- Kotlin20 = 'kotlin-2.0',
- Kotlin23 = 'kotlin-2.3',
- Cpp17 = 'cpp-17',
- Cpp20 = 'cpp-20',
- Bun10 = 'bun-1.0',
- Bun11 = 'bun-1.1',
- Bun12 = 'bun-1.2',
- Bun13 = 'bun-1.3',
- Go123 = 'go-1.23',
- Go124 = 'go-1.24',
- Go125 = 'go-1.25',
- Go126 = 'go-1.26',
- Rust183 = 'rust-1.83',
- Static1 = 'static-1',
- Flutter324 = 'flutter-3.24',
- Flutter327 = 'flutter-3.27',
- Flutter329 = 'flutter-3.29',
- Flutter332 = 'flutter-3.32',
- Flutter335 = 'flutter-3.35',
- Flutter338 = 'flutter-3.38',
- Flutter341 = 'flutter-3.41',
-}
\ No newline at end of file
diff --git a/src/enums/schedule-resource-type.ts b/src/enums/schedule-resource-type.ts
new file mode 100644
index 00000000..25ffc458
--- /dev/null
+++ b/src/enums/schedule-resource-type.ts
@@ -0,0 +1,6 @@
+export enum ScheduleResourceType {
+ Function = 'function',
+ Execution = 'execution',
+ Message = 'message',
+ Backup = 'backup',
+}
\ No newline at end of file
diff --git a/src/enums/adapter.ts b/src/enums/site-adapter.ts
similarity index 61%
rename from src/enums/adapter.ts
rename to src/enums/site-adapter.ts
index a3b1ae0c..8d593a5d 100644
--- a/src/enums/adapter.ts
+++ b/src/enums/site-adapter.ts
@@ -1,4 +1,4 @@
-export enum Adapter {
+export enum SiteAdapter {
Static = 'static',
Ssr = 'ssr',
}
\ No newline at end of file
diff --git a/src/enums/runtime.ts b/src/enums/site-build-runtime.ts
similarity index 96%
rename from src/enums/runtime.ts
rename to src/enums/site-build-runtime.ts
index f4d20688..440ce2b0 100644
--- a/src/enums/runtime.ts
+++ b/src/enums/site-build-runtime.ts
@@ -1,4 +1,4 @@
-export enum Runtime {
+export enum SiteBuildRuntime {
Node145 = 'node-14.5',
Node160 = 'node-16.0',
Node180 = 'node-18.0',
@@ -48,6 +48,7 @@ export enum Runtime {
Dart39 = 'dart-3.9',
Dart310 = 'dart-3.10',
Dart311 = 'dart-3.11',
+ Dart312 = 'dart-3.12',
Dotnet60 = 'dotnet-6.0',
Dotnet70 = 'dotnet-7.0',
Dotnet80 = 'dotnet-8.0',
@@ -88,4 +89,5 @@ export enum Runtime {
Flutter335 = 'flutter-3.35',
Flutter338 = 'flutter-3.38',
Flutter341 = 'flutter-3.41',
+ Flutter344 = 'flutter-3.44',
}
\ No newline at end of file
diff --git a/src/enums/framework.ts b/src/enums/site-framework.ts
similarity index 92%
rename from src/enums/framework.ts
rename to src/enums/site-framework.ts
index 7093da33..ec4eaf51 100644
--- a/src/enums/framework.ts
+++ b/src/enums/site-framework.ts
@@ -1,4 +1,4 @@
-export enum Framework {
+export enum SiteFramework {
Analog = 'analog',
Angular = 'angular',
Nextjs = 'nextjs',
diff --git a/src/enums/use-cases.ts b/src/enums/site-template-use-case.ts
similarity index 59%
rename from src/enums/use-cases.ts
rename to src/enums/site-template-use-case.ts
index d8e7306c..7e29c016 100644
--- a/src/enums/use-cases.ts
+++ b/src/enums/site-template-use-case.ts
@@ -1,16 +1,11 @@
-export enum UseCases {
- Starter = 'starter',
- Databases = 'databases',
- Ai = 'ai',
- Messaging = 'messaging',
- Utilities = 'utilities',
- Devtools = 'dev-tools',
- Auth = 'auth',
+export enum SiteTemplateUseCase {
Portfolio = 'portfolio',
+ Starter = 'starter',
Events = 'events',
Ecommerce = 'ecommerce',
Documentation = 'documentation',
Blog = 'blog',
+ Ai = 'ai',
Forms = 'forms',
Dashboard = 'dashboard',
}
\ No newline at end of file
diff --git a/src/enums/status-code.ts b/src/enums/status-code.ts
deleted file mode 100644
index 1f3adf8b..00000000
--- a/src/enums/status-code.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export enum StatusCode {
- MovedPermanently301 = '301',
- Found302 = '302',
- TemporaryRedirect307 = '307',
- PermanentRedirect308 = '308',
-}
\ No newline at end of file
diff --git a/src/enums/status.ts b/src/enums/status.ts
deleted file mode 100644
index abaf754f..00000000
--- a/src/enums/status.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export enum Status {
- Active = 'active',
-}
\ No newline at end of file
diff --git a/src/index.ts b/src/index.ts
index 3acb7d9f..c26bc0d8 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -22,7 +22,9 @@ export { Locale } from './services/locale';
export { Manager } from './services/manager';
export { Messaging } from './services/messaging';
export { Migrations } from './services/migrations';
+export { Organization } from './services/organization';
export { Organizations } from './services/organizations';
+export { Presences } from './services/presences';
export { Project } from './services/project';
export { Projects } from './services/projects';
export { Proxy } from './services/proxy';
@@ -31,6 +33,7 @@ export { Storage } from './services/storage';
export { TablesDB } from './services/tables-db';
export { Teams } from './services/teams';
export { Tokens } from './services/tokens';
+export { Usage } from './services/usage';
export { Users } from './services/users';
export { Vcs } from './services/vcs';
export { VectorsDB } from './services/vectors-db';
@@ -44,14 +47,14 @@ export { Role } from './role';
export { ID } from './id';
export { Channel } from './channel';
export { Operator, Condition } from './operator';
-export { Scopes } from './enums/scopes';
+export { AccountKeyScopes } from './enums/account-key-scopes';
export { AuthenticatorType } from './enums/authenticator-type';
export { AuthenticationFactor } from './enums/authentication-factor';
export { OAuthProvider } from './enums/o-auth-provider';
export { Browser } from './enums/browser';
export { CreditCard } from './enums/credit-card';
export { Flag } from './enums/flag';
-export { Theme } from './enums/theme';
+export { BrowserTheme } from './enums/browser-theme';
export { Timezone } from './enums/timezone';
export { BrowserPermission } from './enums/browser-permission';
export { ImageFormat } from './enums/image-format';
@@ -59,55 +62,60 @@ export { BackupServices } from './enums/backup-services';
export { Platform } from './enums/platform';
export { ConsoleResourceType } from './enums/console-resource-type';
export { QuerySuggestionResource } from './enums/query-suggestion-resource';
+export { ProjectEmailTemplateId } from './enums/project-email-template-id';
+export { ProjectEmailTemplateLocale } from './enums/project-email-template-locale';
export { UsageRange } from './enums/usage-range';
export { RelationshipType } from './enums/relationship-type';
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 { RegistrationType } from './enums/registration-type';
-export { FilterType } from './enums/filter-type';
-export { Runtime } from './enums/runtime';
-export { Runtimes } from './enums/runtimes';
-export { UseCases } from './enums/use-cases';
+export { DomainRegistrationType } from './enums/domain-registration-type';
+export { DomainSuggestionType } from './enums/domain-suggestion-type';
+export { FunctionRuntime } from './enums/function-runtime';
+export { ProjectKeyScopes } from './enums/project-key-scopes';
+export { FunctionTemplateUseCase } from './enums/function-template-use-case';
export { TemplateReferenceType } from './enums/template-reference-type';
export { VCSReferenceType } from './enums/vcs-reference-type';
export { DeploymentDownloadType } from './enums/deployment-download-type';
export { ExecutionMethod } from './enums/execution-method';
-export { Name } from './enums/name';
-export { ResourceType } from './enums/resource-type';
+export { HealthQueueName } from './enums/health-queue-name';
+export { BlockResourceType } from './enums/block-resource-type';
+export { Region } from './enums/region';
+export { CacheTarget } from './enums/cache-target';
+export { CacheDatabase } from './enums/cache-database';
export { MessagePriority } from './enums/message-priority';
export { SmtpEncryption } from './enums/smtp-encryption';
export { AppwriteMigrationResource } from './enums/appwrite-migration-resource';
-export { OnDuplicate } from './enums/on-duplicate';
+export { MigrationOnDuplicate } from './enums/migration-on-duplicate';
export { FirebaseMigrationResource } from './enums/firebase-migration-resource';
export { NHostMigrationResource } from './enums/n-host-migration-resource';
export { SupabaseMigrationResource } from './enums/supabase-migration-resource';
-export { Addon } from './enums/addon';
-export { AuthMethod } from './enums/auth-method';
-export { Prompt } from './enums/prompt';
-export { ProjectPolicy } from './enums/project-policy';
-export { ProtocolId } from './enums/protocol-id';
-export { ServiceId } from './enums/service-id';
-export { Secure } from './enums/secure';
-export { EmailTemplateType } from './enums/email-template-type';
-export { EmailTemplateLocale } from './enums/email-template-locale';
+export { OrganizationKeyScopes } from './enums/organization-key-scopes';
+export { OrganizationAddon } from './enums/organization-addon';
+export { ProjectAuthMethodId } from './enums/project-auth-method-id';
+export { ProjectOAuth2GooglePrompt } from './enums/project-o-auth-2-google-prompt';
+export { ProjectOAuthProviderId } from './enums/project-o-auth-provider-id';
+export { ProjectPolicyId } from './enums/project-policy-id';
+export { ProjectProtocolId } from './enums/project-protocol-id';
+export { ProjectServiceId } from './enums/project-service-id';
+export { ProjectSMTPSecure } from './enums/project-smtp-secure';
export { ProjectUsageRange } from './enums/project-usage-range';
-export { Region } from './enums/region';
-export { Status } from './enums/status';
-export { StatusCode } from './enums/status-code';
+export { ScheduleResourceType } from './enums/schedule-resource-type';
+export { ProjectStatus } from './enums/project-status';
+export { RedirectStatusCode } from './enums/redirect-status-code';
export { ProxyResourceType } from './enums/proxy-resource-type';
-export { Framework } from './enums/framework';
-export { BuildRuntime } from './enums/build-runtime';
-export { Adapter } from './enums/adapter';
-export { Frameworks } from './enums/frameworks';
+export { SiteFramework } from './enums/site-framework';
+export { SiteBuildRuntime } from './enums/site-build-runtime';
+export { SiteAdapter } from './enums/site-adapter';
+export { SiteTemplateUseCase } from './enums/site-template-use-case';
export { Compression } from './enums/compression';
export { ImageGravity } from './enums/image-gravity';
export { TablesDBIndexType } from './enums/tables-db-index-type';
export { PasswordHash } from './enums/password-hash';
export { MessagingProviderType } from './enums/messaging-provider-type';
export { VCSDetectionType } from './enums/vcs-detection-type';
-export { Model } from './enums/model';
+export { EmbeddingModel } from './enums/embedding-model';
export { VectorsDBIndexType } from './enums/vectors-db-index-type';
export { DatabaseType } from './enums/database-type';
export { AttributeStatus } from './enums/attribute-status';
diff --git a/src/models.ts b/src/models.ts
index cef64a94..2d8e3619 100644
--- a/src/models.ts
+++ b/src/models.ts
@@ -7,6 +7,9 @@ import { DetectionRuntimeType } from "./enums/detection-runtime-type"
import { DeploymentStatus } from "./enums/deployment-status"
import { ExecutionTrigger } from "./enums/execution-trigger"
import { ExecutionStatus } from "./enums/execution-status"
+import { ProjectAuthMethodId } from "./enums/project-auth-method-id"
+import { ProjectServiceId } from "./enums/project-service-id"
+import { ProjectProtocolId } from "./enums/project-protocol-id"
import { OAuth2GooglePrompt } from "./enums/o-auth-2-google-prompt"
import { PlatformType } from "./enums/platform-type"
import { HealthAntivirusStatus } from "./enums/health-antivirus-status"
@@ -53,6 +56,20 @@ export namespace Models {
documents: Document[];
}
+ /**
+ * Presences List
+ */
+ export type PresenceList = {
+ /**
+ * Total number of presences that matched your query.
+ */
+ total: number;
+ /**
+ * List of presences.
+ */
+ presences: Presence[];
+ }
+
/**
* Tables List
*/
@@ -848,11 +865,11 @@ export namespace Models {
/**
* Database backup policies.
*/
- policies: Index[];
+ policies: BackupPolicy[];
/**
* Database backup archives.
*/
- archives: Collection[];
+ archives: BackupArchive[];
}
/**
@@ -3183,6 +3200,48 @@ export namespace Models {
[__default]: true;
};
+ /**
+ * Presence
+ */
+ export type Presence = {
+ /**
+ * Presence ID.
+ */
+ $id: string;
+ /**
+ * Presence creation date in ISO 8601 format.
+ */
+ $createdAt: string;
+ /**
+ * Presence update date in ISO 8601 format.
+ */
+ $updatedAt: string;
+ /**
+ * Presence permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
+ */
+ $permissions: string[];
+ /**
+ * User ID.
+ */
+ userId: string;
+ /**
+ * Presence status.
+ */
+ status?: string;
+ /**
+ * Presence source.
+ */
+ source: string;
+ /**
+ * Presence expiry date in ISO 8601 format.
+ */
+ expiresAt?: string;
+ /**
+ * Presence metadata.
+ */
+ metadata?: object;
+ }
+
/**
* Log
*/
@@ -3784,6 +3843,10 @@ export namespace Models {
* File original size in bytes.
*/
sizeOriginal: number;
+ /**
+ * File actual stored size in bytes after compression and/or encryption.
+ */
+ sizeActual: number;
/**
* Total number of chunks available
*/
@@ -4102,6 +4165,14 @@ export namespace Models {
* Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests
*/
providerSilentMode: boolean;
+ /**
+ * List of branch name patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all branches.
+ */
+ providerBranches: string[];
+ /**
+ * List of file path patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all file changes.
+ */
+ providerPaths: string[];
/**
* Machine specification for deployment builds.
*/
@@ -4340,6 +4411,14 @@ export namespace Models {
* Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests
*/
providerSilentMode: boolean;
+ /**
+ * List of branch name patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all branches.
+ */
+ providerBranches: string[];
+ /**
+ * List of file path patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all file changes.
+ */
+ providerPaths: string[];
/**
* Machine specification for deployment builds.
*/
@@ -5056,132 +5135,12 @@ export namespace Models {
* Project name.
*/
name: string;
- /**
- * Project description.
- */
- description: string;
/**
* Project team ID.
*/
teamId: string;
/**
- * Project logo file ID.
- */
- logo: string;
- /**
- * Project website URL.
- */
- url: string;
- /**
- * Company legal name.
- */
- legalName: string;
- /**
- * Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format.
- */
- legalCountry: string;
- /**
- * State name.
- */
- legalState: string;
- /**
- * City name.
- */
- legalCity: string;
- /**
- * Company Address.
- */
- legalAddress: string;
- /**
- * Company Tax ID.
- */
- legalTaxId: string;
- /**
- * Session duration in seconds.
- */
- authDuration: number;
- /**
- * Max users allowed. 0 is unlimited.
- */
- authLimit: number;
- /**
- * Max sessions allowed per user. 100 maximum.
- */
- authSessionsLimit: number;
- /**
- * Max allowed passwords in the history list per user. Max passwords limit allowed in history is 20. Use 0 for disabling password history.
- */
- authPasswordHistory: number;
- /**
- * Whether or not to check user's password against most commonly used passwords.
- */
- authPasswordDictionary: boolean;
- /**
- * Whether or not to check the user password for similarity with their personal data.
- */
- authPersonalDataCheck: boolean;
- /**
- * Whether or not to disallow disposable email addresses during signup and email updates.
- */
- authDisposableEmails: boolean;
- /**
- * Whether or not to require canonical email addresses during signup and email updates.
- */
- authCanonicalEmails: boolean;
- /**
- * Whether or not to disallow free email addresses during signup and email updates.
- */
- authFreeEmails: boolean;
- /**
- * An array of mock numbers and their corresponding verification codes (OTPs).
- */
- authMockNumbers: MockNumber[];
- /**
- * Whether or not to send session alert emails to users.
- */
- authSessionAlerts: boolean;
- /**
- * Whether or not to show user names in the teams membership response.
- */
- authMembershipsUserName: boolean;
- /**
- * Whether or not to show user emails in the teams membership response.
- */
- authMembershipsUserEmail: boolean;
- /**
- * Whether or not to show user MFA status in the teams membership response.
- */
- authMembershipsMfa: boolean;
- /**
- * Whether or not to show user IDs in the teams membership response.
- */
- authMembershipsUserId: boolean;
- /**
- * Whether or not to show user phone numbers in the teams membership response.
- */
- authMembershipsUserPhone: boolean;
- /**
- * Whether or not all existing sessions should be invalidated on password change
- */
- authInvalidateSessions: boolean;
- /**
- * List of Auth Providers.
- */
- oAuthProviders: AuthProvider[];
- /**
- * List of Platforms.
- */
- platforms: (Models.PlatformWeb | Models.PlatformApple | Models.PlatformAndroid | Models.PlatformWindows | Models.PlatformLinux)[];
- /**
- * List of Webhooks.
- */
- webhooks: Webhook[];
- /**
- * List of API Keys.
- */
- keys: Key[];
- /**
- * List of dev keys.
+ * Deprecated since 1.9.5: List of dev keys.
*/
devKeys: DevKey[];
/**
@@ -5241,129 +5200,75 @@ export namespace Models {
*/
status: string;
/**
- * Email/Password auth method status
- */
- authEmailPassword: boolean;
- /**
- * Magic URL auth method status
- */
- authUsersAuthMagicURL: boolean;
- /**
- * Email (OTP) auth method status
- */
- authEmailOtp: boolean;
- /**
- * Anonymous auth method status
- */
- authAnonymous: boolean;
- /**
- * Invites auth method status
- */
- authInvites: boolean;
- /**
- * JWT auth method status
+ * List of auth methods.
*/
- authJWT: boolean;
+ authMethods: ProjectAuthMethod[];
/**
- * Phone auth method status
+ * List of services.
*/
- authPhone: boolean;
+ services: ProjectService[];
/**
- * Account service status
+ * List of protocols.
*/
- serviceStatusForAccount: boolean;
+ protocols: ProjectProtocol[];
/**
- * Avatars service status
- */
- serviceStatusForAvatars: boolean;
- /**
- * Databases (legacy) service status
- */
- serviceStatusForDatabases: boolean;
- /**
- * TablesDB service status
- */
- serviceStatusForTablesdb: boolean;
- /**
- * Locale service status
- */
- serviceStatusForLocale: boolean;
- /**
- * Health service status
- */
- serviceStatusForHealth: boolean;
- /**
- * Project service status
- */
- serviceStatusForProject: boolean;
- /**
- * Storage service status
- */
- serviceStatusForStorage: boolean;
- /**
- * Teams service status
- */
- serviceStatusForTeams: boolean;
- /**
- * Users service status
- */
- serviceStatusForUsers: boolean;
- /**
- * VCS service status
- */
- serviceStatusForVcs: boolean;
- /**
- * Sites service status
- */
- serviceStatusForSites: boolean;
- /**
- * Functions service status
- */
- serviceStatusForFunctions: boolean;
- /**
- * Proxy service status
- */
- serviceStatusForProxy: boolean;
- /**
- * GraphQL service status
+ * Project region
*/
- serviceStatusForGraphql: boolean;
+ region: string;
/**
- * Migrations service status
+ * Billing limits reached
*/
- serviceStatusForMigrations: boolean;
+ billingLimits?: BillingLimits;
/**
- * Messaging service status
+ * Project blocks information
*/
- serviceStatusForMessaging: boolean;
+ blocks: Block[];
/**
- * REST protocol status
+ * Last time the project was accessed via console. Used with plan's projectInactivityDays to determine if project is paused.
*/
- protocolStatusForRest: boolean;
+ consoleAccessedAt: string;
+ }
+
+ /**
+ * ProjectAuthMethod
+ */
+ export type ProjectAuthMethod = {
/**
- * GraphQL protocol status
+ * Auth method ID.
*/
- protocolStatusForGraphql: boolean;
+ $id: ProjectAuthMethodId;
/**
- * Websocket protocol status
+ * Auth method status.
*/
- protocolStatusForWebsocket: boolean;
+ enabled: boolean;
+ }
+
+ /**
+ * ProjectService
+ */
+ export type ProjectService = {
/**
- * Project region
+ * Service ID.
*/
- region: string;
+ $id: ProjectServiceId;
/**
- * Billing limits reached
+ * Service status.
*/
- billingLimits: BillingLimits;
+ enabled: boolean;
+ }
+
+ /**
+ * ProjectProtocol
+ */
+ export type ProjectProtocol = {
/**
- * Project blocks information
+ * Protocol ID.
*/
- blocks: Block[];
+ $id: ProjectProtocolId;
/**
- * Last time the project was accessed via console. Used with plan's projectInactivityDays to determine if project is paused.
+ * Protocol status.
*/
- consoleAccessedAt: string;
+ enabled: boolean;
}
/**
@@ -6668,32 +6573,6 @@ export namespace Models {
userMFA: boolean;
}
- /**
- * AuthProvider
- */
- export type AuthProvider = {
- /**
- * Auth Provider.
- */
- key: string;
- /**
- * Auth Provider name.
- */
- name: string;
- /**
- * OAuth 2.0 application ID.
- */
- appId: string;
- /**
- * OAuth 2.0 application secret. Might be JSON string if provider requires extra configuration. This property is write-only and always returned empty.
- */
- secret: string;
- /**
- * Auth Provider is active and can be used to create session.
- */
- enabled: boolean;
- }
-
/**
* Platform Web
*/
@@ -7322,6 +7201,24 @@ export namespace Models {
sessions: Metric[];
}
+ /**
+ * UsagePresence
+ */
+ export type UsagePresence = {
+ /**
+ * Time range of the usage stats.
+ */
+ range: string;
+ /**
+ * Current total number of online users.
+ */
+ usersOnlineTotal: number;
+ /**
+ * Aggregated number of online users per period.
+ */
+ presences: Metric[];
+ }
+
/**
* StorageUsage
*/
@@ -7855,7 +7752,7 @@ export namespace Models {
}
/**
- * UsageProject
+ * Project
*/
export type UsageProject = {
/**
@@ -8964,6 +8861,10 @@ export namespace Models {
* Number of functions to be migrated.
*/
function: number;
+ /**
+ * Number of platforms to be migrated.
+ */
+ platform: number;
/**
* Number of sites to be migrated.
*/
@@ -8992,6 +8893,10 @@ export namespace Models {
* Version of the Appwrite instance to be migrated.
*/
version: string;
+ /**
+ * Number of backup policies to be migrated.
+ */
+ backuppolicy: number;
}
/**
@@ -9003,21 +8908,21 @@ export namespace Models {
*/
$id: string;
/**
- * User type.
+ * Actor type.
*/
- userType: string;
+ actorType: string;
/**
- * User ID.
+ * Actor ID.
*/
- userId: string;
+ actorId: string;
/**
- * User Email.
+ * Actor Email.
*/
- userEmail: string;
+ actorEmail: string;
/**
- * User Name.
+ * Actor Name.
*/
- userName: string;
+ actorName: string;
/**
* Resource parent.
*/
@@ -9159,45 +9064,155 @@ export namespace Models {
}
/**
- * AggregationTeam
+ * Addon
*/
- export type AggregationTeam = {
+ export type Addon = {
/**
- * Aggregation ID.
+ * Addon ID.
*/
$id: string;
/**
- * Aggregation creation time in ISO 8601 format.
+ * Addon creation time in ISO 8601 format.
*/
$createdAt: string;
/**
- * Aggregation update date in ISO 8601 format.
+ * Addon update date in ISO 8601 format.
*/
$updatedAt: string;
/**
- * Aggregation permissions. [Learn more about permissions](/docs/permissions).
+ * Addon permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
*/
$permissions: string[];
/**
- * Beginning date of the invoice
+ * Addon key
*/
- from: string;
+ key: string;
/**
- * End date of the invoice
+ * Resource type (organization or project)
*/
- to: string;
+ resourceType: string;
/**
- * Total storage usage
+ * Resource ID
*/
- usageStorage: number;
+ resourceId: string;
/**
- * Total storage usage with builds storage
+ * Payment status. Possible values: pending (awaiting payment confirmation e.g. 3DS), active (payment confirmed and addon is running).
*/
- usageTotalStorage: number;
+ status: string;
/**
- * Total files storage usage
+ * Current value for this billing cycle. For toggle addons: 1 (on) or 0 (off). For numeric addons: the active quantity.
*/
- usageFilesStorage: number;
+ currentValue: number;
+ /**
+ * Value to apply at the start of the next billing cycle. Null means no change is scheduled. For toggle addons, 0 means the addon will be removed at the next cycle.
+ */
+ nextValue?: number;
+ }
+
+ /**
+ * AddonPrice
+ */
+ export type AddonPrice = {
+ /**
+ * Addon key.
+ */
+ addonKey: string;
+ /**
+ * Addon display name.
+ */
+ name: string;
+ /**
+ * Full monthly price of the addon.
+ */
+ monthlyPrice: number;
+ /**
+ * Calculated prorated amount for the current billing cycle.
+ */
+ proratedAmount: number;
+ /**
+ * Days remaining in the current billing cycle.
+ */
+ remainingDays: number;
+ /**
+ * Total days in the billing cycle.
+ */
+ totalCycleDays: number;
+ /**
+ * Currency code.
+ */
+ currency: string;
+ /**
+ * When the current billing cycle ends.
+ */
+ billingCycleEnd: string;
+ }
+
+ /**
+ * Breakdown
+ */
+ export type AggregationBreakdown = {
+ /**
+ * Aggregation ID.
+ */
+ $id: string;
+ /**
+ * Project name
+ */
+ name: string;
+ /**
+ * Project region
+ */
+ region: string;
+ /**
+ * Aggregated amount
+ */
+ amount: number;
+ /**
+ *
+ */
+ resources: UsageResources[];
+ }
+
+ /**
+ * Team
+ */
+ export type AggregationTeam = {
+ /**
+ * Aggregation ID.
+ */
+ $id: string;
+ /**
+ * Aggregation creation time in ISO 8601 format.
+ */
+ $createdAt: string;
+ /**
+ * Aggregation update date in ISO 8601 format.
+ */
+ $updatedAt: string;
+ /**
+ * Aggregation permissions. [Learn more about permissions](/docs/permissions).
+ */
+ $permissions: string[];
+ /**
+ * Beginning date of the invoice
+ */
+ from: string;
+ /**
+ * End date of the invoice
+ */
+ to: string;
+ /**
+ * Total storage usage
+ */
+ usageStorage: number;
+ /**
+ * Total storage usage with builds storage
+ */
+ usageTotalStorage: number;
+ /**
+ * Total files storage usage
+ */
+ usageFilesStorage: number;
/**
* Total deployments storage usage
*/
@@ -9280,32 +9295,6 @@ export namespace Models {
resources: UsageResources[];
}
- /**
- * AggregationBreakdown
- */
- export type AggregationBreakdown = {
- /**
- * Aggregation ID.
- */
- $id: string;
- /**
- * Project name
- */
- name: string;
- /**
- * Project region
- */
- region: string;
- /**
- * Aggregated amount
- */
- amount: number;
- /**
- *
- */
- resources: UsageResources[];
- }
-
/**
* Archive
*/
@@ -9361,7 +9350,7 @@ export namespace Models {
}
/**
- * BillingAddress
+ * Address
*/
export type BillingAddress = {
/**
@@ -9398,6 +9387,44 @@ export namespace Models {
postalCode: string;
}
+ /**
+ * Limits
+ */
+ export type BillingLimits = {
+ /**
+ * Bandwidth limit
+ */
+ bandwidth?: number;
+ /**
+ * Storage limit
+ */
+ storage?: number;
+ /**
+ * Users limit
+ */
+ users?: number;
+ /**
+ * Executions limit
+ */
+ executions?: number;
+ /**
+ * GBHours limit
+ */
+ GBHours?: number;
+ /**
+ * Image transformations limit
+ */
+ imageTransformations?: number;
+ /**
+ * Auth phone limit
+ */
+ authPhone?: number;
+ /**
+ * Budget limit percentage
+ */
+ budgetLimit?: number;
+ }
+
/**
* billingPlan
*/
@@ -9657,7 +9684,7 @@ export namespace Models {
}
/**
- * BillingPlanAddon
+ * Addon
*/
export type BillingPlanAddon = {
/**
@@ -9671,7 +9698,7 @@ export namespace Models {
}
/**
- * BillingPlanAddonDetails
+ * Details
*/
export type BillingPlanAddonDetails = {
/**
@@ -9709,7 +9736,7 @@ export namespace Models {
}
/**
- * BillingPlanLimits
+ * PlanLimits
*/
export type BillingPlanLimits = {
/**
@@ -9732,44 +9759,6 @@ export namespace Models {
baa: boolean;
}
- /**
- * BillingLimits
- */
- export type BillingLimits = {
- /**
- * Bandwidth limit
- */
- bandwidth: number;
- /**
- * Storage limit
- */
- storage: number;
- /**
- * Users limit
- */
- users: number;
- /**
- * Executions limit
- */
- executions: number;
- /**
- * GBHours limit
- */
- GBHours: number;
- /**
- * Image transformations limit
- */
- imageTransformations: number;
- /**
- * Auth phone limit
- */
- authPhone: number;
- /**
- * Budget limit percentage
- */
- budgetLimit: number;
- }
-
/**
* Block
*/
@@ -9884,48 +9873,6 @@ export namespace Models {
footer?: boolean;
}
- /**
- * Program
- */
- export type Program = {
- /**
- * Program ID
- */
- $id: string;
- /**
- * Program title
- */
- title: string;
- /**
- * Program description
- */
- description: string;
- /**
- * Program tag for highlighting on console
- */
- tag: string;
- /**
- * Program icon for highlighting on console
- */
- icon: string;
- /**
- * URL for more information on this program
- */
- url: string;
- /**
- * Whether this program is active
- */
- active: boolean;
- /**
- * Whether this program is external
- */
- external: boolean;
- /**
- * Billing plan ID that this is program is associated with.
- */
- billingPlanId: string;
- }
-
/**
* Coupon
*/
@@ -10043,1465 +9990,1481 @@ export namespace Models {
}
/**
- * Downgrade Feedback
+ * DNSRecord
*/
- export type DowngradeFeedback = {
+ export type DnsRecord = {
/**
- * Feedback ID.
+ * DNS Record ID.
*/
$id: string;
/**
- * Feedback creation date in ISO 8601 format.
+ * DNS Record creation time in ISO 8601 format.
*/
$createdAt: string;
/**
- * Feedback update date in ISO 8601 format.
+ * DNS Record update date in ISO 8601 format.
*/
$updatedAt: string;
/**
- * Feedback reason
+ * DNS record type (e.g. A, CNAME, MX).
*/
- title: string;
+ type: string;
/**
- * Feedback message
+ * Record name or subdomain.
*/
- message: string;
+ name: string;
/**
- * Plan ID downgrading from
+ * Value of the record (IP address, domain, etc.).
*/
- fromPlanId: string;
+ value: string;
/**
- * Plan ID downgrading to
+ * Time to live (in seconds).
*/
- toPlanId: string;
+ ttl: number;
/**
- * Organization ID
+ * Record priority (commonly used for MX).
*/
- teamId: string;
+ priority: number;
/**
- * User ID who submitted feedback
+ * Whether this record is locked (read-only).
*/
- userId: string;
+ lock: boolean;
/**
- * Console version
+ * Record weight (used for SRV records).
*/
- version: string;
+ weight: number;
+ /**
+ * Target port (used for SRV records).
+ */
+ port: number;
+ /**
+ * Comment for the DNS record.
+ */
+ comment: string;
}
/**
- * Invoice
+ * Domain
*/
- export type Invoice = {
+ export type Domain = {
/**
- * Invoice ID.
+ * Domain ID.
*/
$id: string;
/**
- * Invoice creation time in ISO 8601 format.
+ * Domain creation time in ISO 8601 format.
*/
$createdAt: string;
/**
- * Invoice update date in ISO 8601 format.
+ * Domain update date in ISO 8601 format.
*/
$updatedAt: string;
/**
- * Invoice permissions. [Learn more about permissions](/docs/permissions).
- */
- $permissions: string[];
- /**
- * Project ID
- */
- teamId: string;
- /**
- * Aggregation ID
- */
- aggregationId: string;
- /**
- * Billing plan selected. Can be one of `tier-0`, `tier-1` or `tier-2`.
- */
- plan: string;
- /**
- * Usage breakdown per resource
+ * Domain name.
*/
- usage: UsageResources[];
+ domain: string;
/**
- * Invoice Amount
+ * Domain registrar (e.g. "appwrite" or "third_party").
*/
- amount: number;
+ registrar: string;
/**
- * Tax percentage
+ * Nameservers setting. "Appwrite" or empty string.
*/
- tax: number;
+ nameservers: string;
/**
- * Tax amount
+ * Domain expiry date in ISO 8601 format.
*/
- taxAmount: number;
+ expire: string;
/**
- * VAT percentage
+ * Domain renewal date in ISO 8601 format.
*/
- vat: number;
+ renewal: string;
/**
- * VAT amount
+ * If set to true, the domain will automatically renew.
*/
- vatAmount: number;
+ autoRenewal: boolean;
/**
- * Gross amount after vat, tax, and discounts applied.
+ * Renewal price (in cents).
*/
- grossAmount: number;
+ renewalPrice: number;
/**
- * Credits used.
+ * Transfer status for domains being transferred in.
*/
- creditsUsed: number;
+ transferStatus: DomainTransferStatusEnum;
/**
- * Currency the invoice is in
+ * Team ID.
*/
- currency: string;
+ teamId: string;
/**
- * Client secret for processing failed payments in front-end
+ * Dns records
*/
- clientSecret: string;
+ dnsRecords: DnsRecord[];
+ }
+
+ /**
+ * DomainPrice
+ */
+ export type DomainPrice = {
/**
- * Invoice status
+ * Domain name.
*/
- status: string;
+ domain: string;
/**
- * Invoice type. Can be one of `subscription`, `domain_purchase`, `domain_renewal`, `domain_transfer`, or `addon_*`.
+ * Top-level domain for the requested domain.
*/
- type: string;
+ tld: string;
/**
- * Last payment error associated with the invoice
+ * Whether the domain is currently available for registration.
*/
- lastError: string;
+ available: boolean;
/**
- * Invoice due date.
+ * Domain registration price.
*/
- dueAt: string;
+ price: number;
/**
- * Beginning date of the invoice
+ * Price period in years.
*/
- from: string;
+ periodYears: number;
/**
- * End date of the invoice
+ * Whether the domain is a premium domain.
*/
- to: string;
+ premium: boolean;
}
/**
- * Organization
+ * DomainPurchase
*/
- export type Organization = {
+ export type DomainPurchase = {
/**
- * Team ID.
+ * Purchase/invoice ID.
*/
$id: string;
/**
- * Team creation date in ISO 8601 format.
+ * Purchase creation time in ISO 8601 format.
*/
$createdAt: string;
/**
- * Team update date in ISO 8601 format.
+ * Purchase update date in ISO 8601 format.
*/
$updatedAt: string;
/**
- * Team name.
+ * Domain document ID.
*/
- name: string;
+ domainId: string;
/**
- * Total number of team members.
+ * Domain name.
*/
- total: number;
+ domain: string;
/**
- * Team preferences as a key-value object
+ * Team ID that owns the domain.
*/
- prefs: Preferences;
+ organizationId: string;
/**
- * Project budget limit
+ * Domain purchase status.
*/
- billingBudget: number;
+ status: DomainPurchaseStatus;
/**
- * Project budget limit
+ * Stripe client secret for 3DS; empty when not applicable.
*/
- budgetAlerts: number[];
+ clientSecret: string;
/**
- * Organization's billing plan ID.
+ * Purchase amount.
*/
- billingPlan: string;
+ amount: number;
/**
- * Organization's billing plan ID.
+ * Currency code.
*/
- billingPlanId: string;
+ currency: string;
+ }
+
+ /**
+ * DomainSuggestion
+ */
+ export type DomainSuggestion = {
/**
- * Organization's billing plan.
+ * Domain suggestion.
*/
- billingPlanDetails: BillingPlan;
+ domain: string;
/**
- * Billing email set for the organization.
+ * Is the domain premium?
*/
- billingEmail: string;
+ premium: boolean;
/**
- * Billing cycle start date.
+ * Domain price.
*/
- billingStartDate: string;
+ price?: number;
/**
- * Current invoice cycle start date.
+ * Is the domain available?
*/
- billingCurrentInvoiceDate: string;
+ available: boolean;
+ }
+
+ /**
+ * domainTransferOut
+ */
+ export type DomainTransferOut = {
/**
- * Next invoice cycle start date.
+ * Domain transfer authorization code.
*/
- billingNextInvoiceDate: string;
+ authCode: string;
+ }
+
+ /**
+ * domainTransferStatus
+ */
+ export type DomainTransferStatus = {
/**
- * Start date of trial.
+ * Transfer status.
*/
- billingTrialStartDate: string;
+ status: DomainTransferStatusEnum;
/**
- * Number of trial days.
+ * Additional transfer status information.
*/
- billingTrialDays: number;
+ reason: string;
/**
- * Current active aggregation id.
+ * Transfer status timestamp in ISO 8601 format.
*/
- billingAggregationId: string;
+ timestamp: string;
+ }
+
+ /**
+ * Downgrade Feedback
+ */
+ export type DowngradeFeedback = {
/**
- * Current active aggregation id.
+ * Feedback ID.
*/
- billingInvoiceId: string;
+ $id: string;
/**
- * Default payment method.
+ * Feedback creation date in ISO 8601 format.
*/
- paymentMethodId: string;
+ $createdAt: string;
/**
- * Default payment method.
+ * Feedback update date in ISO 8601 format.
*/
- billingAddressId: string;
+ $updatedAt: string;
/**
- * Backup payment method.
+ * Feedback reason
*/
- backupPaymentMethodId: string;
+ title: string;
/**
- * Team status.
+ * Feedback message
*/
- status: string;
+ message: string;
/**
- * Remarks on team status.
+ * Plan ID downgrading from
*/
- remarks: string;
+ fromPlanId: string;
/**
- * Organization agreements
+ * Plan ID downgrading to
*/
- agreementBAA: string;
+ toPlanId: string;
/**
- * Program manager's name.
+ * Organization ID
*/
- programManagerName: string;
+ teamId: string;
/**
- * Program manager's calendar link.
+ * User ID who submitted feedback
*/
- programManagerCalendar: string;
+ userId: string;
/**
- * Program's discord channel name.
+ * Console version
*/
- programDiscordChannelName: string;
+ version: string;
+ }
+
+ /**
+ * Estimation
+ */
+ export type Estimation = {
/**
- * Program's discord channel URL.
+ * Total amount
*/
- programDiscordChannelUrl: string;
+ amount: number;
/**
- * Billing limits reached
+ * Gross payable amount
*/
- billingLimits: BillingLimits;
+ grossAmount: number;
/**
- * Billing plan selected for downgrade.
+ * Discount amount
*/
- billingPlanDowngrade: string;
+ discount: number;
/**
- * Tax Id
+ * Credits amount
*/
- billingTaxId: string;
+ credits: number;
/**
- * Marked for deletion
+ * Estimation items
*/
- markedForDeletion: boolean;
+ items: EstimationItem[];
/**
- * Product with which the organization is associated (appwrite or imagine)
+ * Estimation discount items
*/
- platform: string;
+ discounts: EstimationItem[];
/**
- * Selected projects
+ * Trial days
*/
- projects: string[];
+ trialDays: number;
+ /**
+ * Trial end date
+ */
+ trialEndDate?: string;
}
/**
- * PaymentAuthentication
+ * DeleteOrganization
*/
- export type PaymentAuthentication = {
- /**
- * Message for the end user to show on Console.
- */
- message: string;
- /**
- * Stripe client secret to use for validation.
- */
- clientSecret: string;
+ export type EstimationDeleteOrganization = {
/**
- * Organization ID for which the payment authentication is needed.
+ * List of unpaid invoices
*/
- organizationId: string;
+ unpaidInvoices: Invoice[];
+ }
+
+ /**
+ * Item
+ */
+ export type EstimationItem = {
/**
- * Invoice ID against which the payment needs to be validated.
+ * Label
*/
- invoiceId: string;
+ label: string;
/**
- * Addon ID to use when calling the addon validate endpoint. Empty when authentication is not for an addon.
+ * Gross payable amount
*/
- addonId: string;
+ value: number;
}
/**
- * paymentMethod
+ * EstimationPlanChange
*/
- export type PaymentMethod = {
+ export type EstimationPlanChange = {
/**
- * Payment Method ID.
+ * Current billing plan ID
*/
- $id: string;
+ currentBillingPlanId: string;
/**
- * Payment method creation time in ISO 8601 format.
+ * Target billing plan ID
*/
- $createdAt: string;
+ targetBillingPlanId: string;
/**
- * Payment method update date in ISO 8601 format.
+ * Direction of plan change: upgrade, downgrade, or same
*/
- $updatedAt: string;
+ direction: string;
/**
- * Payment method permissions. [Learn more about permissions](/docs/permissions).
+ * Cost estimation details
*/
- $permissions: string[];
+ estimation: PlanChangeEstimationDetails;
/**
- * Payment method ID from the payment provider
+ * Plan limits and compliance information
*/
- providerMethodId: string;
+ limits: PlanChangeLimits;
+ }
+
+ /**
+ * UpdatePlan
+ */
+ export type EstimationUpdatePlan = {
/**
- * Client secret hash for payment setup
+ * Total amount
*/
- clientSecret: string;
+ amount: number;
/**
- * User ID from the payment provider.
+ * Gross payable amount
*/
- providerUserId: string;
+ grossAmount: number;
/**
- * ID of the Team.
+ * Discount amount
*/
- userId: string;
+ discount: number;
/**
- * Expiry month of the payment method.
+ * Credits amount
*/
- expiryMonth: number;
+ credits: number;
/**
- * Expiry year of the payment method.
+ * Estimation items
*/
- expiryYear: number;
+ items: EstimationItem[];
/**
- * Last 4 digit of the payment method
+ * Estimation discount items
*/
- last4: string;
+ discounts: EstimationItem[];
/**
- * Payment method brand
+ * Trial days
*/
- brand: string;
+ trialDays: number;
/**
- * Name of the owner
+ * Trial end date
*/
- name: string;
+ trialEndDate?: string;
/**
- * Mandate ID of the payment method
+ * Organization's existing credits
*/
- mandateId: string;
+ organizationCredits: number;
+ }
+
+ /**
+ * Invoice
+ */
+ export type Invoice = {
/**
- * Country of the payment method
+ * Invoice ID.
*/
- country: string;
+ $id: string;
/**
- * State of the payment method
+ * Invoice creation time in ISO 8601 format.
*/
- state: string;
+ $createdAt: string;
/**
- * Last payment error associated with the payment method.
+ * Invoice update date in ISO 8601 format.
*/
- lastError: string;
+ $updatedAt: string;
/**
- * True when it's the default payment method.
+ * Invoice permissions. [Learn more about permissions](/docs/permissions).
*/
- default: boolean;
+ $permissions: string[];
/**
- * True when payment method has expired.
+ * Project ID
*/
- expired: boolean;
+ teamId: string;
/**
- * True when payment method has failed to process multiple times.
+ * Aggregation ID
*/
- failed: boolean;
- }
-
- /**
- * backup
- */
- export type BackupPolicy = {
+ aggregationId: string;
/**
- * Backup policy ID.
+ * Billing plan selected. Can be one of `tier-0`, `tier-1` or `tier-2`.
*/
- $id: string;
+ plan: string;
/**
- * Backup policy name.
+ * Usage breakdown per resource
*/
- name: string;
+ usage: UsageResources[];
/**
- * Policy creation date in ISO 8601 format.
+ * Invoice Amount
*/
- $createdAt: string;
+ amount: number;
/**
- * Policy update date in ISO 8601 format.
+ * Tax percentage
*/
- $updatedAt: string;
+ tax: number;
/**
- * The services that are backed up by this policy.
+ * Tax amount
*/
- services: string[];
+ taxAmount: number;
/**
- * The resources that are backed up by this policy.
+ * VAT percentage
*/
- resources: string[];
+ vat: number;
/**
- * The resource ID to backup. Set only if this policy should backup a single resource.
+ * VAT amount
*/
- resourceId?: string;
+ vatAmount: number;
/**
- * The resource type to backup. Set only if this policy should backup a single resource.
+ * Gross amount after vat, tax, and discounts applied.
*/
- resourceType?: string;
+ grossAmount: number;
/**
- * How many days to keep the backup before it will be automatically deleted.
+ * Credits used.
*/
- retention: number;
+ creditsUsed: number;
/**
- * Policy backup schedule in CRON format.
+ * Currency the invoice is in
*/
- schedule: string;
+ currency: string;
/**
- * Is this policy enabled.
+ * Client secret for processing failed payments in front-end
*/
- enabled: boolean;
- }
-
- /**
- * Region
- */
- export type ConsoleRegion = {
+ clientSecret: string;
/**
- * Region ID
+ * Invoice status
*/
- $id: string;
+ status: string;
/**
- * Region name
+ * Invoice type. Can be one of `subscription`, `domain_purchase`, `domain_renewal`, `domain_transfer`, or `addon_*`.
*/
- name: string;
+ type: string;
/**
- * Does the organization have access to this region.
+ * Last payment error associated with the invoice
*/
- available: boolean;
+ lastError: string;
/**
- * Does the backend support this region.
+ * Invoice due date.
*/
- disabled: boolean;
+ dueAt: string;
/**
- * Is this the region default.
+ * Beginning date of the invoice
*/
- default: boolean;
+ from: string;
/**
- * Region flag code.
+ * End date of the invoice
*/
- flag: string;
+ to: string;
}
/**
- * Restoration
+ * Organization
*/
- export type BackupRestoration = {
+ export type Organization = {
/**
- * Restoration ID.
+ * Team ID.
*/
$id: string;
/**
- * Restoration creation time in ISO 8601 format.
+ * Team creation date in ISO 8601 format.
*/
$createdAt: string;
/**
- * Restoration update date in ISO 8601 format.
+ * Team update date in ISO 8601 format.
*/
$updatedAt: string;
/**
- * Backup archive ID.
- */
- archiveId: string;
- /**
- * Backup policy ID.
+ * Team name.
*/
- policyId: string;
+ name: string;
/**
- * The status of the restoration. Possible values: pending, downloading, processing, completed, failed.
+ * Total number of team members.
*/
- status: string;
+ total: number;
/**
- * The backup start time.
+ * Team preferences as a key-value object
*/
- startedAt: string;
+ prefs: Preferences;
/**
- * Migration ID.
+ * Project budget limit
*/
- migrationId: string;
+ billingBudget: number;
/**
- * The services that are backed up by this policy.
+ * Project budget limit
*/
- services: string[];
+ budgetAlerts: number[];
/**
- * The resources that are backed up by this policy.
+ * Organization's billing plan ID.
*/
- resources: string[];
+ billingPlan: string;
/**
- * Optional data in key-value object.
+ * Organization's billing plan ID.
*/
- options: string;
- }
-
- /**
- * Review
- */
- export type Review = {
+ billingPlanId: string;
/**
- * Name of user
+ * Organization's billing plan.
*/
- name: string;
+ billingPlanDetails: BillingPlan;
/**
- * Reviewer image
+ * Billing email set for the organization.
*/
- image: string;
+ billingEmail: string;
/**
- * Reviewer description
+ * Billing cycle start date.
*/
- description: string;
+ billingStartDate: string;
/**
- * Review
+ * Current invoice cycle start date.
*/
- review: string;
- }
-
- /**
- * Roles
- */
- export type Roles = {
+ billingCurrentInvoiceDate: string;
/**
- * Array of scopes accessible to current user.
+ * Next invoice cycle start date.
*/
- scopes: string[];
+ billingNextInvoiceDate: string;
/**
- * Array of roles assigned to current user.
+ * Start date of trial.
*/
- roles: string[];
- }
-
- /**
- * UsageOrganization
- */
- export type UsageOrganization = {
+ billingTrialStartDate: string;
/**
- * Aggregated stats for number of requests.
+ * Number of trial days.
*/
- bandwidth: Metric[];
+ billingTrialDays: number;
/**
- * Aggregated stats for consumed bandwidth.
+ * Current active aggregation id.
*/
- users: Metric[];
+ billingAggregationId: string;
/**
- * Aggregated stats for function executions.
+ * Current active aggregation id.
*/
- executions: Metric[];
+ billingInvoiceId: string;
/**
- * Aggregated stats for database reads.
+ * Default payment method.
*/
- databasesReads: Metric[];
+ paymentMethodId: string;
/**
- * Aggregated stats for database writes.
+ * Default payment method.
*/
- databasesWrites: Metric[];
+ billingAddressId: string;
/**
- * Aggregated stats for file transformations.
+ * Backup payment method.
*/
- imageTransformations: Metric[];
+ backupPaymentMethodId: string;
/**
- * Aggregated stats for total file transformations.
+ * Team status.
*/
- imageTransformationsTotal: number;
+ status: string;
/**
- * Aggregated stats for file transformations.
+ * Remarks on team status.
*/
- screenshotsGenerated: Metric[];
+ remarks: string;
/**
- * Aggregated stats for total file transformations.
+ * Organization agreements
*/
- screenshotsGeneratedTotal: number;
+ agreementBAA: string;
/**
- * Aggregated stats for imagine credits.
+ * Program manager's name.
*/
- imagineCredits: Metric[];
+ programManagerName: string;
/**
- * Aggregated stats for total imagine credits.
+ * Program manager's calendar link.
*/
- imagineCreditsTotal: number;
+ programManagerCalendar: string;
/**
- * Aggregated stats for total users.
+ * Program's discord channel name.
*/
- usersTotal: number;
+ programDiscordChannelName: string;
/**
- * Aggregated stats for total executions.
+ * Program's discord channel URL.
*/
- executionsTotal: number;
+ programDiscordChannelUrl: string;
/**
- * Aggregated stats for function executions in mb seconds.
+ * Billing limits reached
*/
- executionsMBSecondsTotal: number;
+ billingLimits?: BillingLimits;
/**
- * Aggregated stats for function builds in mb seconds.
+ * Billing plan selected for downgrade.
*/
- buildsMBSecondsTotal: number;
+ billingPlanDowngrade: string;
/**
- * Aggregated stats for total file storage.
+ * Tax Id
*/
- filesStorageTotal: number;
+ billingTaxId: string;
/**
- * Aggregated stats for total builds storage.
+ * Marked for deletion
*/
- buildsStorageTotal: number;
+ markedForDeletion: boolean;
/**
- * Aggregated stats for total deployments storage.
+ * Product with which the organization is associated (appwrite or imagine)
*/
- deploymentsStorageTotal: number;
+ platform: string;
/**
- * Aggregated stats for total databases storage.
+ * Selected projects
*/
- databasesStorageTotal: number;
+ projects: string[];
+ }
+
+ /**
+ * PaymentAuthentication
+ */
+ export type PaymentAuthentication = {
/**
- * Aggregated stats for total databases reads.
+ * Message for the end user to show on Console.
*/
- databasesReadsTotal: number;
+ message: string;
/**
- * Aggregated stats for total databases writes.
+ * Stripe client secret to use for validation.
*/
- databasesWritesTotal: number;
+ clientSecret: string;
/**
- * Aggregated stats for total backups storage.
+ * Organization ID for which the payment authentication is needed.
*/
- backupsStorageTotal: number;
+ organizationId: string;
/**
- * Aggregated stats for total storage.
+ * Invoice ID against which the payment needs to be validated.
*/
- storageTotal: number;
+ invoiceId: string;
/**
- * Aggregated stats for total auth phone.
+ * Addon ID to use when calling the addon validate endpoint. Empty when authentication is not for an addon.
*/
- authPhoneTotal: number;
+ addonId: string;
+ }
+
+ /**
+ * paymentMethod
+ */
+ export type PaymentMethod = {
/**
- * Aggregated stats for total auth phone estimation.
+ * Payment Method ID.
*/
- authPhoneEstimate: number;
+ $id: string;
/**
- * Aggregated stats for each projects.
+ * Payment method creation time in ISO 8601 format.
*/
- projects: UsageOrganizationProject[];
+ $createdAt: string;
/**
- * Aggregated stats for realtime connections.
+ * Payment method update date in ISO 8601 format.
*/
- realtimeConnections: Metric[];
+ $updatedAt: string;
/**
- * Aggregated stats for total realtime connections.
+ * Payment method permissions. [Learn more about permissions](/docs/permissions).
*/
- realtimeConnectionsTotal: number;
+ $permissions: string[];
/**
- * Aggregated stats for realtime messages.
+ * Payment method ID from the payment provider
*/
- realtimeMessages: Metric[];
+ providerMethodId: string;
/**
- * Aggregated stats for total realtime messages.
+ * Client secret hash for payment setup
*/
- realtimeMessagesTotal: number;
+ clientSecret: string;
/**
- * Aggregated stats for realtime bandwidth.
+ * User ID from the payment provider.
*/
- realtimeBandwidth: Metric[];
+ providerUserId: string;
/**
- * Aggregated stats for total realtime bandwidth.
+ * ID of the Team.
*/
- realtimeBandwidthTotal: number;
- }
-
- /**
- * UsageOrganizationProject
- */
- export type UsageOrganizationProject = {
+ userId: string;
/**
- * projectId
+ * Expiry month of the payment method.
*/
- projectId: string;
+ expiryMonth: number;
/**
- * Aggregated stats for number of requests.
+ * Expiry year of the payment method.
*/
- bandwidth: Metric[];
+ expiryYear: number;
/**
- * Aggregated stats for consumed bandwidth.
+ * Last 4 digit of the payment method
*/
- users: Metric[];
+ last4: string;
/**
- * Aggregated stats for function executions.
+ * Payment method brand
*/
- executions: number;
+ brand: string;
/**
- * Aggregated stats for database reads.
+ * Name of the owner
*/
- databasesReads: Metric[];
+ name: string;
/**
- * Aggregated stats for database writes.
+ * Mandate ID of the payment method
*/
- databasesWrites: Metric[];
+ mandateId: string;
/**
- * Aggregated stats for function executions in mb seconds.
+ * Country of the payment method
*/
- executionsMBSeconds: number;
+ country: string;
/**
- * Aggregated stats for function builds in mb seconds.
+ * State of the payment method
*/
- buildsMBSeconds: number;
+ state: string;
/**
- * Aggregated stats for number of documents.
+ * Last payment error associated with the payment method.
*/
- storage: number;
+ lastError: string;
/**
- * Aggregated stats for phone authentication.
+ * True when it's the default payment method.
*/
- authPhoneTotal: number;
+ default: boolean;
/**
- * Aggregated stats for phone authentication estimated cost.
+ * True when payment method has expired.
*/
- authPhoneEstimate: number;
+ expired: boolean;
/**
- * Aggregated stats for total databases reads.
+ * True when payment method has failed to process multiple times.
*/
- databasesReadsTotal: number;
+ failed: boolean;
+ }
+
+ /**
+ * PlanChangeEstimationDetails
+ */
+ export type PlanChangeEstimationDetails = {
/**
- * Aggregated stats for total databases writes.
+ * Currency code
*/
- databasesWritesTotal: number;
+ currency: string;
/**
- * Aggregated stats for file transformations.
+ * Gross amount after all discounts and credits
*/
- imageTransformations: Metric[];
+ grossAmount: number;
/**
- * Aggregated stats for total file transformations.
+ * Credits applied from coupon
*/
- imageTransformationsTotal: number;
+ credits: number;
/**
- * Aggregated stats for file transformations.
+ * Organization's existing credits applied
*/
- screenshotsGenerated: Metric[];
+ organizationCredits: number;
/**
- * Aggregated stats for total file transformations.
+ * Discount amount from prorated invoices
*/
- screenshotsGeneratedTotal: number;
+ discount: number;
/**
- * Aggregated stats for imagine credits.
+ * Total amount before discounts and credits
*/
- imagineCredits: number;
+ amount: number;
/**
- * Aggregated stats for realtime connections.
+ * Next invoice date
*/
- realtimeConnections: number;
+ nextInvoiceDate: string;
/**
- * Aggregated stats for realtime messages.
+ * Line items breakdown
*/
- realtimeMessages: number;
+ items: object;
/**
- * Aggregated stats for realtime bandwidth.
+ * Applied discounts breakdown
*/
- realtimeBandwidth: number;
+ discounts: object;
}
/**
- * Domain
+ * PlanChangeLimits
*/
- export type Domain = {
+ export type PlanChangeLimits = {
/**
- * Domain ID.
+ * Total number of projects in the organization
*/
- $id: string;
+ totalProjects: number;
/**
- * Domain creation time in ISO 8601 format.
+ * Number of projects exceeding target plan limits
*/
- $createdAt: string;
+ nonCompliantProjects: number;
/**
- * Domain update date in ISO 8601 format.
+ * Whether the plan change is allowed
*/
- $updatedAt: string;
+ canChangePlan: boolean;
/**
- * Domain name.
+ * Project compliance details
*/
- domain: string;
+ projects: PlanChangeProjectCompliance[];
/**
- * Domain registrar (e.g. "appwrite" or "third_party").
+ * Active addon keys that the target plan does not support. When non-empty, `canChangePlan` is false.
*/
- registrar: string;
+ unsupportedAddons: string[];
+ }
+
+ /**
+ * PlanChangeProjectCompliance
+ */
+ export type PlanChangeProjectCompliance = {
/**
- * Nameservers setting. "Appwrite" or empty string.
+ * Project ID
+ */
+ $id: string;
+ /**
+ * Project name
+ */
+ name: string;
+ /**
+ * Whether the project complies with target plan limits
+ */
+ isCompliant: boolean;
+ /**
+ * Resource compliance details
*/
- nameservers: string;
+ resources: PlanChangeResourceCompliance[];
/**
- * Domain expiry date in ISO 8601 format.
+ * Failure reason when compliance could not be evaluated. Present only when the project DB or Regions API was unreachable; in that case `isCompliant` is false (fail closed) and `resources` is empty.
*/
- expire: string;
+ error?: string;
+ }
+
+ /**
+ * PlanChangeResourceCompliance
+ */
+ export type PlanChangeResourceCompliance = {
/**
- * Domain renewal date in ISO 8601 format.
+ * Resource type
*/
- renewal: string;
+ type: string;
/**
- * If set to true, the domain will automatically renew.
+ * Current usage count
*/
- autoRenewal: boolean;
+ currentUsage: number;
/**
- * Renewal price (in cents).
+ * Allowed limit in target plan
*/
- renewalPrice: number;
+ limit: number;
/**
- * Transfer status for domains being transferred in.
+ * Compliance status
*/
- transferStatus: DomainTransferStatusEnum;
+ status: string;
/**
- * Team ID.
+ * Number of resources exceeding the limit
*/
- teamId: string;
+ excess: number;
/**
- * Dns records
+ * Suggestion for resolving the compliance issue
*/
- dnsRecords: DnsRecord[];
+ resolutionHint: string;
}
/**
- * DomainPurchase
+ * backup
*/
- export type DomainPurchase = {
+ export type BackupPolicy = {
/**
- * Purchase/invoice ID.
+ * Backup policy ID.
*/
$id: string;
/**
- * Purchase creation time in ISO 8601 format.
+ * Backup policy name.
+ */
+ name: string;
+ /**
+ * Policy creation date in ISO 8601 format.
*/
$createdAt: string;
/**
- * Purchase update date in ISO 8601 format.
+ * Policy update date in ISO 8601 format.
*/
$updatedAt: string;
/**
- * Domain document ID.
+ * The services that are backed up by this policy.
*/
- domainId: string;
+ services: string[];
/**
- * Domain name.
+ * The resources that are backed up by this policy.
*/
- domain: string;
+ resources: string[];
/**
- * Team ID that owns the domain.
+ * The resource ID to backup. Set only if this policy should backup a single resource.
*/
- organizationId: string;
+ resourceId?: string;
/**
- * Domain purchase status.
+ * The resource type to backup. Set only if this policy should backup a single resource.
*/
- status: DomainPurchaseStatus;
+ resourceType?: string;
/**
- * Stripe client secret for 3DS; empty when not applicable.
+ * How many days to keep the backup before it will be automatically deleted.
*/
- clientSecret: string;
+ retention: number;
/**
- * Purchase amount.
+ * Policy backup schedule in CRON format.
*/
- amount: number;
+ schedule: string;
/**
- * Currency code.
+ * Is this policy enabled.
*/
- currency: string;
+ enabled: boolean;
}
/**
- * DNSRecord
+ * Program
*/
- export type DnsRecord = {
+ export type Program = {
/**
- * DNS Record ID.
+ * Program 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.
+ * Program title
*/
- name: string;
+ title: string;
/**
- * Value of the record (IP address, domain, etc.).
+ * Program description
*/
- value: string;
+ description: string;
/**
- * Time to live (in seconds).
+ * Program tag for highlighting on console
*/
- ttl: number;
+ tag: string;
/**
- * Record priority (commonly used for MX).
+ * Program icon for highlighting on console
*/
- priority: number;
+ icon: string;
/**
- * Whether this record is locked (read-only).
+ * URL for more information on this program
*/
- lock: boolean;
+ url: string;
/**
- * Record weight (used for SRV records).
+ * Whether this program is active
*/
- weight: number;
+ active: boolean;
/**
- * Target port (used for SRV records).
+ * Whether this program is external
*/
- port: number;
+ external: boolean;
/**
- * Comment for the DNS record.
+ * Billing plan ID that this is program is associated with.
*/
- comment: string;
+ billingPlanId: string;
}
/**
- * UsageResource
+ * Region
*/
- export type UsageResources = {
+ export type ConsoleRegion = {
/**
- * Invoice name
+ * Region ID
*/
- name: string;
+ $id: string;
/**
- * Invoice value
+ * Region name
*/
- value: number;
+ name: string;
/**
- * Invoice amount
+ * Does the organization have access to this region.
*/
- amount: number;
+ available: boolean;
/**
- * Invoice rate
+ * Does the backend support this region.
*/
- rate: number;
+ disabled: boolean;
/**
- * Invoice description
+ * Is this the region default.
*/
- desc: string;
+ default: boolean;
/**
- * Resource ID
+ * Region flag code.
*/
- resourceId: string;
+ flag: string;
}
/**
- * usageBillingPlan
+ * Restoration
*/
- export type UsageBillingPlan = {
+ export type BackupRestoration = {
/**
- * Bandwidth additional resources
+ * Restoration ID.
*/
- bandwidth: AdditionalResource;
+ $id: string;
/**
- * Executions additional resources
+ * Restoration creation time in ISO 8601 format.
*/
- executions: AdditionalResource;
+ $createdAt: string;
/**
- * Member additional resources
+ * Restoration update date in ISO 8601 format.
*/
- member: AdditionalResource;
+ $updatedAt: string;
/**
- * Realtime additional resources
+ * Backup archive ID.
*/
- realtime: AdditionalResource;
+ archiveId: string;
/**
- * Realtime messages additional resources
+ * Backup policy ID.
*/
- realtimeMessages: AdditionalResource;
+ policyId: string;
/**
- * Realtime bandwidth additional resources
+ * The status of the restoration. Possible values: pending, downloading, processing, completed, failed.
*/
- realtimeBandwidth: AdditionalResource;
+ status: string;
/**
- * Storage additional resources
+ * The backup start time.
*/
- storage: AdditionalResource;
+ startedAt: string;
/**
- * User additional resources
+ * Migration ID.
*/
- users: AdditionalResource;
+ migrationId: string;
/**
- * GBHour additional resources
+ * The services that are backed up by this policy.
*/
- GBHours: AdditionalResource;
+ services: string[];
/**
- * Image transformation additional resources
+ * The resources that are backed up by this policy.
*/
- imageTransformations: AdditionalResource;
+ resources: string[];
/**
- * Credits additional resources
+ * Optional data in key-value object.
*/
- credits: AdditionalResource;
+ options: string;
}
/**
- * Estimation
+ * Review
*/
- export type Estimation = {
- /**
- * Total amount
- */
- amount: number;
- /**
- * Gross payable amount
- */
- grossAmount: number;
+ export type Review = {
/**
- * Discount amount
+ * Name of user
*/
- discount: number;
+ name: string;
/**
- * Credits amount
+ * Reviewer image
*/
- credits: number;
+ image: string;
/**
- * Estimation items
+ * Reviewer description
*/
- items: EstimationItem[];
+ description: string;
/**
- * Estimation discount items
+ * Review
*/
- discounts: EstimationItem[];
+ review: string;
+ }
+
+ /**
+ * Roles
+ */
+ export type Roles = {
/**
- * Trial days
+ * Array of scopes accessible to current user.
*/
- trialDays: number;
+ scopes: string[];
/**
- * Trial end date
+ * Array of roles assigned to current user.
*/
- trialEndDate?: string;
+ roles: string[];
}
/**
- * EstimationUpdatePlan
+ * usageBillingPlan
*/
- export type EstimationUpdatePlan = {
+ export type UsageBillingPlan = {
+ /**
+ * Bandwidth additional resources
+ */
+ bandwidth: AdditionalResource;
+ /**
+ * Executions additional resources
+ */
+ executions: AdditionalResource;
/**
- * Total amount
+ * Member additional resources
*/
- amount: number;
+ member: AdditionalResource;
/**
- * Gross payable amount
+ * Realtime additional resources
*/
- grossAmount: number;
+ realtime: AdditionalResource;
/**
- * Discount amount
+ * Realtime messages additional resources
*/
- discount: number;
+ realtimeMessages: AdditionalResource;
/**
- * Credits amount
+ * Realtime bandwidth additional resources
*/
- credits: number;
+ realtimeBandwidth: AdditionalResource;
/**
- * Estimation items
+ * Storage additional resources
*/
- items: EstimationItem[];
+ storage: AdditionalResource;
/**
- * Estimation discount items
+ * User additional resources
*/
- discounts: EstimationItem[];
+ users: AdditionalResource;
/**
- * Trial days
+ * GBHour additional resources
*/
- trialDays: number;
+ GBHours: AdditionalResource;
/**
- * Trial end date
+ * Image transformation additional resources
*/
- trialEndDate?: string;
+ imageTransformations: AdditionalResource;
/**
- * Organization's existing credits
+ * Credits additional resources
*/
- organizationCredits: number;
+ credits: AdditionalResource;
}
/**
- * EstimationPlanChange
+ * usageEvent
*/
- export type EstimationPlanChange = {
+ export type UsageEvent = {
/**
- * Current billing plan ID
+ * The metric key.
*/
- currentBillingPlanId: string;
+ metric: string;
/**
- * Target billing plan ID
+ * The metric value.
*/
- targetBillingPlanId: string;
+ value: number;
/**
- * Direction of plan change: upgrade, downgrade, or same
+ * The event timestamp.
*/
- direction: string;
+ time: string;
/**
- * Cost estimation details
+ * The API endpoint path.
*/
- estimation: PlanChangeEstimationDetails;
+ path: string;
/**
- * Plan limits and compliance information
+ * The HTTP method.
*/
- limits: PlanChangeLimits;
- }
-
- /**
- * PlanChangeEstimationDetails
- */
- export type PlanChangeEstimationDetails = {
+ method: string;
/**
- * Currency code
+ * HTTP status code. Stored as string to preserve unset state (empty string = not available).
*/
- currency: string;
+ status: string;
/**
- * Gross amount after all discounts and credits
+ * The resource type.
*/
- grossAmount: number;
+ resourceType: string;
/**
- * Credits applied from coupon
+ * The resource ID.
*/
- credits: number;
+ resourceId: string;
/**
- * Organization's existing credits applied
+ * Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format.
*/
- organizationCredits: number;
+ countryCode: string;
/**
- * Discount amount from prorated invoices
+ * The user agent string.
*/
- discount: number;
+ userAgent: string;
+ }
+
+ /**
+ * usageGauge
+ */
+ export type UsageGauge = {
/**
- * Total amount before discounts and credits
+ * The metric key.
*/
- amount: number;
+ metric: string;
/**
- * Next invoice date
+ * The current snapshot value.
*/
- nextInvoiceDate: string;
+ value: number;
/**
- * Line items breakdown
+ * The snapshot timestamp.
*/
- items: object;
+ time: string;
/**
- * Applied discounts breakdown
+ * The resource type.
*/
- discounts: object;
+ resourceType: string;
+ /**
+ * The resource ID.
+ */
+ resourceId: string;
}
/**
- * PlanChangeLimits
+ * Organization
*/
- export type PlanChangeLimits = {
+ export type UsageOrganization = {
/**
- * Total number of projects in the organization
+ * Aggregated stats for number of requests.
*/
- totalProjects: number;
+ bandwidth: Metric[];
/**
- * Number of projects exceeding target plan limits
+ * Aggregated stats for consumed bandwidth.
*/
- nonCompliantProjects: number;
+ users: Metric[];
/**
- * Whether the plan change is allowed
+ * Aggregated stats for function executions.
*/
- canChangePlan: boolean;
+ executions: Metric[];
/**
- * Project compliance details
+ * Aggregated stats for database reads.
*/
- projects: PlanChangeProjectCompliance[];
+ databasesReads: Metric[];
/**
- * Active addon keys that the target plan does not support. When non-empty, `canChangePlan` is false.
+ * Aggregated stats for database writes.
*/
- unsupportedAddons: string[];
- }
-
- /**
- * PlanChangeProjectCompliance
- */
- export type PlanChangeProjectCompliance = {
+ databasesWrites: Metric[];
/**
- * Project ID
+ * Aggregated stats for file transformations.
*/
- $id: string;
+ imageTransformations: Metric[];
/**
- * Project name
+ * Aggregated stats for total file transformations.
*/
- name: string;
+ imageTransformationsTotal: number;
/**
- * Whether the project complies with target plan limits
+ * Aggregated stats for file transformations.
*/
- isCompliant: boolean;
+ screenshotsGenerated: Metric[];
/**
- * Resource compliance details
+ * Aggregated stats for total file transformations.
*/
- resources: PlanChangeResourceCompliance[];
+ screenshotsGeneratedTotal: number;
/**
- * Failure reason when compliance could not be evaluated. Present only when the project DB or Regions API was unreachable; in that case `isCompliant` is false (fail closed) and `resources` is empty.
+ * Aggregated stats for imagine credits.
*/
- error?: string;
- }
-
- /**
- * PlanChangeResourceCompliance
- */
- export type PlanChangeResourceCompliance = {
+ imagineCredits: Metric[];
/**
- * Resource type
+ * Aggregated stats for total imagine credits.
*/
- type: string;
+ imagineCreditsTotal: number;
/**
- * Current usage count
+ * Aggregated stats for total users.
*/
- currentUsage: number;
+ usersTotal: number;
/**
- * Allowed limit in target plan
+ * Aggregated stats for total executions.
*/
- limit: number;
+ executionsTotal: number;
/**
- * Compliance status
+ * Aggregated stats for function executions in mb seconds.
*/
- status: string;
+ executionsMBSecondsTotal: number;
/**
- * Number of resources exceeding the limit
+ * Aggregated stats for function builds in mb seconds.
*/
- excess: number;
+ buildsMBSecondsTotal: number;
/**
- * Suggestion for resolving the compliance issue
+ * Aggregated stats for total file storage.
*/
- resolutionHint: string;
- }
-
- /**
- * EstimationDeleteOrganization
- */
- export type EstimationDeleteOrganization = {
+ filesStorageTotal: number;
/**
- * List of unpaid invoices
+ * Aggregated stats for total builds storage.
*/
- unpaidInvoices: Invoice[];
- }
-
- /**
- * EstimationItem
- */
- export type EstimationItem = {
+ buildsStorageTotal: number;
/**
- * Label
+ * Aggregated stats for total deployments storage.
*/
- label: string;
+ deploymentsStorageTotal: number;
/**
- * Gross payable amount
+ * Aggregated stats for total databases storage.
*/
- value: number;
- }
-
- /**
- * DomainPrice
- */
- export type DomainPrice = {
+ databasesStorageTotal: number;
/**
- * Domain name.
+ * Aggregated stats for total databases reads.
*/
- domain: string;
+ databasesReadsTotal: number;
/**
- * Top-level domain for the requested domain.
+ * Aggregated stats for total databases writes.
*/
- tld: string;
+ databasesWritesTotal: number;
/**
- * Whether the domain is currently available for registration.
+ * Aggregated stats for total backups storage.
*/
- available: boolean;
+ backupsStorageTotal: number;
/**
- * Domain registration price.
+ * Aggregated stats for total storage.
*/
- price: number;
+ storageTotal: number;
/**
- * Price period in years.
+ * Aggregated stats for total auth phone.
*/
- periodYears: number;
+ authPhoneTotal: number;
/**
- * Whether the domain is a premium domain.
+ * Aggregated stats for total auth phone estimation.
*/
- premium: boolean;
- }
-
- /**
- * DomainSuggestion
- */
- export type DomainSuggestion = {
+ authPhoneEstimate: number;
/**
- * Domain suggestion.
+ * Aggregated stats for each projects.
*/
- domain: string;
+ projects: UsageOrganizationProject[];
/**
- * Is the domain premium?
+ * Aggregated stats for realtime connections.
*/
- premium: boolean;
+ realtimeConnections: Metric[];
/**
- * Domain price.
+ * Aggregated stats for total realtime connections.
*/
- price?: number;
+ realtimeConnectionsTotal: number;
/**
- * Is the domain available?
+ * Aggregated stats for realtime messages.
*/
- available: boolean;
+ realtimeMessages: Metric[];
+ /**
+ * Aggregated stats for total realtime messages.
+ */
+ realtimeMessagesTotal: number;
+ /**
+ * Aggregated stats for realtime bandwidth.
+ */
+ realtimeBandwidth: Metric[];
+ /**
+ * Aggregated stats for total realtime bandwidth.
+ */
+ realtimeBandwidthTotal: number;
}
/**
- * Addon
+ * OrganizationProject
*/
- export type Addon = {
+ export type UsageOrganizationProject = {
/**
- * Addon ID.
+ * projectId
*/
- $id: string;
+ projectId: string;
/**
- * Addon creation time in ISO 8601 format.
+ * Aggregated stats for number of requests.
*/
- $createdAt: string;
+ bandwidth: Metric[];
/**
- * Addon update date in ISO 8601 format.
+ * Aggregated stats for consumed bandwidth.
*/
- $updatedAt: string;
+ users: Metric[];
/**
- * Addon permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
+ * Aggregated stats for function executions.
*/
- $permissions: string[];
+ executions: number;
/**
- * Addon key
+ * Aggregated stats for database reads.
*/
- key: string;
+ databasesReads: Metric[];
/**
- * Resource type (organization or project)
+ * Aggregated stats for database writes.
*/
- resourceType: string;
+ databasesWrites: Metric[];
/**
- * Resource ID
+ * Aggregated stats for function executions in mb seconds.
*/
- resourceId: string;
+ executionsMBSeconds: number;
/**
- * Payment status. Possible values: pending (awaiting payment confirmation e.g. 3DS), active (payment confirmed and addon is running).
+ * Aggregated stats for function builds in mb seconds.
*/
- status: string;
+ buildsMBSeconds: number;
/**
- * Current value for this billing cycle. For toggle addons: 1 (on) or 0 (off). For numeric addons: the active quantity.
+ * Aggregated stats for number of documents.
*/
- currentValue: number;
+ storage: number;
/**
- * Value to apply at the start of the next billing cycle. Null means no change is scheduled. For toggle addons, 0 means the addon will be removed at the next cycle.
+ * Aggregated stats for phone authentication.
*/
- nextValue?: number;
- }
-
- /**
- * AddonPrice
- */
- export type AddonPrice = {
+ authPhoneTotal: number;
/**
- * Addon key.
+ * Aggregated stats for phone authentication estimated cost.
*/
- addonKey: string;
+ authPhoneEstimate: number;
/**
- * Addon display name.
+ * Aggregated stats for total databases reads.
*/
- name: string;
+ databasesReadsTotal: number;
/**
- * Full monthly price of the addon.
+ * Aggregated stats for total databases writes.
*/
- monthlyPrice: number;
+ databasesWritesTotal: number;
/**
- * Calculated prorated amount for the current billing cycle.
+ * Aggregated stats for file transformations.
*/
- proratedAmount: number;
+ imageTransformations: Metric[];
/**
- * Days remaining in the current billing cycle.
+ * Aggregated stats for total file transformations.
*/
- remainingDays: number;
+ imageTransformationsTotal: number;
/**
- * Total days in the billing cycle.
+ * Aggregated stats for file transformations.
*/
- totalCycleDays: number;
+ screenshotsGenerated: Metric[];
/**
- * Currency code.
+ * Aggregated stats for total file transformations.
*/
- currency: string;
+ screenshotsGeneratedTotal: number;
/**
- * When the current billing cycle ends.
+ * Aggregated stats for imagine credits.
*/
- billingCycleEnd: string;
- }
-
- /**
- * domainTransferOut
- */
- export type DomainTransferOut = {
+ imagineCredits: number;
/**
- * Domain transfer authorization code.
+ * Aggregated stats for realtime connections.
*/
- authCode: string;
+ realtimeConnections: number;
+ /**
+ * Aggregated stats for realtime messages.
+ */
+ realtimeMessages: number;
+ /**
+ * Aggregated stats for realtime bandwidth.
+ */
+ realtimeBandwidth: number;
}
/**
- * domainTransferStatus
+ * Resource
*/
- export type DomainTransferStatus = {
+ export type UsageResources = {
/**
- * Transfer status.
+ * Invoice name
*/
- status: DomainTransferStatusEnum;
+ name: string;
/**
- * Additional transfer status information.
+ * Invoice value
*/
- reason: string;
+ value: number;
/**
- * Transfer status timestamp in ISO 8601 format.
+ * Invoice amount
*/
- timestamp: string;
- }
-
- /**
- * Addons list
- */
- export type AddonList = {
+ amount: number;
/**
- * Total number of addons that matched your query.
+ * Invoice rate
*/
- total: number;
+ rate: number;
/**
- * List of addons.
+ * Invoice description
*/
- addons: Addon[];
+ desc: string;
+ /**
+ * Resource ID
+ */
+ resourceId: string;
}
/**
@@ -11518,6 +11481,20 @@ export namespace Models {
events: ActivityEvent[];
}
+ /**
+ * Addons list
+ */
+ export type AddonList = {
+ /**
+ * Total number of addons that matched your query.
+ */
+ total: number;
+ /**
+ * List of addons.
+ */
+ addons: Addon[];
+ }
+
/**
* Aggregation team list
*/
@@ -11575,31 +11552,31 @@ export namespace Models {
}
/**
- * Billing invoices list
+ * Billing address list
*/
- export type InvoiceList = {
+ export type BillingAddressList = {
/**
- * Total number of invoices that matched your query.
+ * Total number of billingAddresses that matched your query.
*/
total: number;
/**
- * List of invoices.
+ * List of billingAddresses.
*/
- invoices: Invoice[];
+ billingAddresses: BillingAddress[];
}
/**
- * Billing address list
+ * Billing invoices list
*/
- export type BillingAddressList = {
+ export type InvoiceList = {
/**
- * Total number of billingAddresses that matched your query.
+ * Total number of invoices that matched your query.
*/
total: number;
/**
- * List of billingAddresses.
+ * List of invoices.
*/
- billingAddresses: BillingAddress[];
+ invoices: Invoice[];
}
/**
@@ -11617,100 +11594,128 @@ export namespace Models {
}
/**
- * Organizations list
+ * Blocks list
*/
- export type OrganizationList = {
+ export type BlockList = {
/**
- * Total number of teams that matched your query.
+ * Total number of blocks that matched your query.
*/
total: number;
/**
- * List of teams.
+ * List of blocks.
*/
- teams: Organization[];
+ blocks: Block[];
}
/**
- * Payment methods list
+ * DNS records list
*/
- export type PaymentMethodList = {
+ export type DnsRecordsList = {
/**
- * Total number of paymentMethods that matched your query.
+ * Total number of dnsRecords that matched your query.
*/
total: number;
/**
- * List of paymentMethods.
+ * List of dnsRecords.
*/
- paymentMethods: PaymentMethod[];
+ dnsRecords: DnsRecord[];
}
/**
- * Blocks list
+ * Domain suggestions list
*/
- export type BlockList = {
+ export type DomainSuggestionsList = {
/**
- * Total number of blocks that matched your query.
+ * Total number of suggestions that matched your query.
*/
total: number;
/**
- * List of blocks.
+ * List of suggestions.
*/
- blocks: Block[];
+ suggestions: DomainSuggestion[];
}
/**
- * Regions list
+ * Domains list
*/
- export type ConsoleRegionList = {
+ export type DomainsList = {
/**
- * Total number of regions that matched your query.
+ * Total number of domains that matched your query.
*/
total: number;
/**
- * List of regions.
+ * List of domains.
*/
- regions: ConsoleRegion[];
+ domains: Domain[];
}
/**
- * Domains list
+ * Organizations list
*/
- export type DomainsList = {
+ export type OrganizationList = {
/**
- * Total number of domains that matched your query.
+ * Total number of teams that matched your query.
*/
total: number;
/**
- * List of domains.
+ * List of teams.
*/
- domains: Domain[];
+ teams: Organization[];
}
/**
- * DNS records list
+ * Payment methods list
*/
- export type DnsRecordsList = {
+ export type PaymentMethodList = {
/**
- * Total number of dnsRecords that matched your query.
+ * Total number of paymentMethods that matched your query.
*/
total: number;
/**
- * List of dnsRecords.
+ * List of paymentMethods.
*/
- dnsRecords: DnsRecord[];
+ paymentMethods: PaymentMethod[];
}
/**
- * Domain suggestions list
+ * Regions list
*/
- export type DomainSuggestionsList = {
+ export type ConsoleRegionList = {
/**
- * Total number of suggestions that matched your query.
+ * Total number of regions that matched your query.
*/
total: number;
/**
- * List of suggestions.
+ * List of regions.
*/
- suggestions: DomainSuggestion[];
+ regions: ConsoleRegion[];
+ }
+
+ /**
+ * Usage events list
+ */
+ export type UsageEventList = {
+ /**
+ * Total number of events that matched your query.
+ */
+ total: number;
+ /**
+ * List of events.
+ */
+ events: UsageEvent[];
+ }
+
+ /**
+ * Usage gauges list
+ */
+ export type UsageGaugeList = {
+ /**
+ * Total number of gauges that matched your query.
+ */
+ total: number;
+ /**
+ * List of gauges.
+ */
+ gauges: UsageGauge[];
}
}
diff --git a/src/services/account.ts b/src/services/account.ts
index e9ef3ae9..b76a97c2 100644
--- a/src/services/account.ts
+++ b/src/services/account.ts
@@ -2,7 +2,7 @@ import { Service } from '../service';
import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
import type { Models } from '../models';
-import { Scopes } from '../enums/scopes';
+import { AccountKeyScopes } from '../enums/account-key-scopes';
import { AuthenticatorType } from '../enums/authenticator-type';
import { AuthenticationFactor } from '../enums/authentication-factor';
import { OAuthProvider } from '../enums/o-auth-provider';
@@ -889,35 +889,35 @@ export class Account {
* Create a new account API key.
*
* @param {string} params.name - Key name. Max length: 128 chars.
- * @param {Scopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed.
+ * @param {AccountKeyScopes[]} params.scopes - Key scopes list. Maximum of 100 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}
*/
- createKey(params: { name: string, scopes: Scopes[], expire?: string }): Promise;
+ createKey(params: { name: string, scopes: AccountKeyScopes[], expire?: string }): Promise;
/**
* Create a new account API key.
*
* @param {string} name - Key name. Max length: 128 chars.
- * @param {Scopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed.
+ * @param {AccountKeyScopes[]} scopes - Key scopes list. Maximum of 100 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}
* @deprecated Use the object parameter style method for a better developer experience.
*/
- createKey(name: string, scopes: Scopes[], expire?: string): Promise;
+ createKey(name: string, scopes: AccountKeyScopes[], expire?: string): Promise;
createKey(
- paramsOrFirst: { name: string, scopes: Scopes[], expire?: string } | string,
- ...rest: [(Scopes[])?, (string)?]
+ paramsOrFirst: { name: string, scopes: AccountKeyScopes[], expire?: string } | string,
+ ...rest: [(AccountKeyScopes[])?, (string)?]
): Promise {
- let params: { name: string, scopes: Scopes[], expire?: string };
+ let params: { name: string, scopes: AccountKeyScopes[], expire?: string };
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
- params = (paramsOrFirst || {}) as { name: string, scopes: Scopes[], expire?: string };
+ params = (paramsOrFirst || {}) as { name: string, scopes: AccountKeyScopes[], expire?: string };
} else {
params = {
name: paramsOrFirst as string,
- scopes: rest[0] as Scopes[],
+ scopes: rest[0] as AccountKeyScopes[],
expire: rest[1] as string
};
}
@@ -1014,37 +1014,37 @@ export class Account {
*
* @param {string} params.keyId - Key unique ID.
* @param {string} params.name - Key name. Max length: 128 chars.
- * @param {Scopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed.
+ * @param {AccountKeyScopes[]} params.scopes - Key scopes list. Maximum of 100 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}
*/
- updateKey(params: { keyId: string, name: string, scopes: Scopes[], expire?: string }): Promise;
+ updateKey(params: { keyId: string, name: string, scopes: AccountKeyScopes[], expire?: string }): Promise;
/**
* Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key.
*
* @param {string} keyId - Key unique ID.
* @param {string} name - Key name. Max length: 128 chars.
- * @param {Scopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed.
+ * @param {AccountKeyScopes[]} scopes - Key scopes list. Maximum of 100 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}
* @deprecated Use the object parameter style method for a better developer experience.
*/
- updateKey(keyId: string, name: string, scopes: Scopes[], expire?: string): Promise;
+ updateKey(keyId: string, name: string, scopes: AccountKeyScopes[], expire?: string): Promise;
updateKey(
- paramsOrFirst: { keyId: string, name: string, scopes: Scopes[], expire?: string } | string,
- ...rest: [(string)?, (Scopes[])?, (string)?]
+ paramsOrFirst: { keyId: string, name: string, scopes: AccountKeyScopes[], expire?: string } | string,
+ ...rest: [(string)?, (AccountKeyScopes[])?, (string)?]
): Promise {
- let params: { keyId: string, name: string, scopes: Scopes[], expire?: string };
+ let params: { keyId: string, name: string, scopes: AccountKeyScopes[], expire?: string };
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
- params = (paramsOrFirst || {}) as { keyId: string, name: string, scopes: Scopes[], expire?: string };
+ params = (paramsOrFirst || {}) as { keyId: string, name: string, scopes: AccountKeyScopes[], expire?: string };
} else {
params = {
keyId: paramsOrFirst as string,
name: rest[0] as string,
- scopes: rest[1] as Scopes[],
+ scopes: rest[1] as AccountKeyScopes[],
expire: rest[2] as string
};
}
diff --git a/src/services/avatars.ts b/src/services/avatars.ts
index eea5a0f8..48d2215b 100644
--- a/src/services/avatars.ts
+++ b/src/services/avatars.ts
@@ -5,7 +5,7 @@ import type { Models } from '../models';
import { Browser } from '../enums/browser';
import { CreditCard } from '../enums/credit-card';
import { Flag } from '../enums/flag';
-import { Theme } from '../enums/theme';
+import { BrowserTheme } from '../enums/browser-theme';
import { Timezone } from '../enums/timezone';
import { BrowserPermission } from '../enums/browser-permission';
import { ImageFormat } from '../enums/image-format';
@@ -567,7 +567,7 @@ export class Avatars {
* @param {number} params.viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280.
* @param {number} params.viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720.
* @param {number} params.scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1.
- * @param {Theme} params.theme - Browser theme. Pass "light" or "dark". Defaults to "light".
+ * @param {BrowserTheme} params.theme - Browser theme. Pass "light" or "dark". Defaults to "light".
* @param {string} params.userAgent - Custom user agent string. Defaults to browser default.
* @param {boolean} params.fullpage - Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0.
* @param {string} params.locale - Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default.
@@ -585,7 +585,7 @@ export class Avatars {
* @throws {AppwriteException}
* @returns {string}
*/
- getScreenshot(params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat }): string;
+ getScreenshot(params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: BrowserTheme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat }): string;
/**
* Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.
*
@@ -598,7 +598,7 @@ export class Avatars {
* @param {number} viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280.
* @param {number} viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720.
* @param {number} scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1.
- * @param {Theme} theme - Browser theme. Pass "light" or "dark". Defaults to "light".
+ * @param {BrowserTheme} theme - Browser theme. Pass "light" or "dark". Defaults to "light".
* @param {string} userAgent - Custom user agent string. Defaults to browser default.
* @param {boolean} fullpage - Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0.
* @param {string} locale - Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default.
@@ -617,15 +617,15 @@ export class Avatars {
* @returns {string}
* @deprecated Use the object parameter style method for a better developer experience.
*/
- getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat): string;
+ getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: BrowserTheme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat): string;
getScreenshot(
- paramsOrFirst: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat } | string,
- ...rest: [(object)?, (number)?, (number)?, (number)?, (Theme)?, (string)?, (boolean)?, (string)?, (Timezone)?, (number)?, (number)?, (number)?, (boolean)?, (BrowserPermission[])?, (number)?, (number)?, (number)?, (number)?, (ImageFormat)?]
+ paramsOrFirst: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: BrowserTheme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat } | string,
+ ...rest: [(object)?, (number)?, (number)?, (number)?, (BrowserTheme)?, (string)?, (boolean)?, (string)?, (Timezone)?, (number)?, (number)?, (number)?, (boolean)?, (BrowserPermission[])?, (number)?, (number)?, (number)?, (number)?, (ImageFormat)?]
): string {
- let params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat };
+ let params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: BrowserTheme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat };
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
- params = (paramsOrFirst || {}) as { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat };
+ params = (paramsOrFirst || {}) as { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: BrowserTheme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat };
} else {
params = {
url: paramsOrFirst as string,
@@ -633,7 +633,7 @@ export class Avatars {
viewportWidth: rest[1] as number,
viewportHeight: rest[2] as number,
scale: rest[3] as number,
- theme: rest[4] as Theme,
+ theme: rest[4] as BrowserTheme,
userAgent: rest[5] as string,
fullpage: rest[6] as boolean,
locale: rest[7] as string,
diff --git a/src/services/console.ts b/src/services/console.ts
index 8e26188b..278fc464 100644
--- a/src/services/console.ts
+++ b/src/services/console.ts
@@ -5,6 +5,8 @@ import type { Models } from '../models';
import { Platform } from '../enums/platform';
import { ConsoleResourceType } from '../enums/console-resource-type';
import { QuerySuggestionResource } from '../enums/query-suggestion-resource';
+import { ProjectEmailTemplateId } from '../enums/project-email-template-id';
+import { ProjectEmailTemplateLocale } from '../enums/project-email-template-locale';
export class Console {
client: Client;
@@ -431,6 +433,29 @@ export class Console {
);
}
+ /**
+ * List all scopes available for organization API keys, along with a description for each scope.
+ *
+ * @throws {AppwriteException}
+ * @returns {Promise}
+ */
+ listOrganizationScopes(): Promise {
+
+ const apiPath = '/console/scopes/organization';
+ const payload: Payload = {};
+ const uri = new URL(this.client.config.endpoint + apiPath);
+
+ const apiHeaders: { [header: string]: string } = {
+ }
+
+ return this.client.call(
+ 'get',
+ uri,
+ apiHeaders,
+ payload
+ );
+ }
+
/**
* List all scopes available for project API keys, along with a description for each scope.
*
@@ -781,6 +806,65 @@ export class Console {
);
}
+ /**
+ * Get the Appwrite built-in default email template for the specified type and locale. Always returns the unmodified default, ignoring any custom project overrides.
+ *
+ * @param {ProjectEmailTemplateId} params.templateId - Email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession
+ * @param {ProjectEmailTemplateLocale} params.locale - Template locale. If left empty, the fallback locale (en) will be used.
+ * @throws {AppwriteException}
+ * @returns {Promise}
+ */
+ getEmailTemplate(params: { templateId: ProjectEmailTemplateId, locale?: ProjectEmailTemplateLocale }): Promise;
+ /**
+ * Get the Appwrite built-in default email template for the specified type and locale. Always returns the unmodified default, ignoring any custom project overrides.
+ *
+ * @param {ProjectEmailTemplateId} templateId - Email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession
+ * @param {ProjectEmailTemplateLocale} locale - Template locale. If left empty, the fallback locale (en) will be used.
+ * @throws {AppwriteException}
+ * @returns {Promise}
+ * @deprecated Use the object parameter style method for a better developer experience.
+ */
+ getEmailTemplate(templateId: ProjectEmailTemplateId, locale?: ProjectEmailTemplateLocale): Promise;
+ getEmailTemplate(
+ paramsOrFirst: { templateId: ProjectEmailTemplateId, locale?: ProjectEmailTemplateLocale } | ProjectEmailTemplateId,
+ ...rest: [(ProjectEmailTemplateLocale)?]
+ ): Promise {
+ let params: { templateId: ProjectEmailTemplateId, locale?: ProjectEmailTemplateLocale };
+
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('templateId' in paramsOrFirst || 'locale' in paramsOrFirst))) {
+ params = (paramsOrFirst || {}) as { templateId: ProjectEmailTemplateId, locale?: ProjectEmailTemplateLocale };
+ } else {
+ params = {
+ templateId: paramsOrFirst as ProjectEmailTemplateId,
+ locale: rest[0] as ProjectEmailTemplateLocale
+ };
+ }
+
+ const templateId = params.templateId;
+ const locale = params.locale;
+
+ if (typeof templateId === 'undefined') {
+ throw new AppwriteException('Missing required parameter: "templateId"');
+ }
+
+ const apiPath = '/console/templates/email/{templateId}'.replace('{templateId}', templateId);
+ const payload: Payload = {};
+ if (typeof locale !== 'undefined') {
+ payload['locale'] = locale;
+ }
+ const uri = new URL(this.client.config.endpoint + apiPath);
+
+ const apiHeaders: { [header: string]: string } = {
+ }
+
+ return this.client.call(
+ 'get',
+ uri,
+ apiHeaders,
+ payload
+ );
+ }
+
/**
* Get all Environment Variables that are relevant for the console.
*
diff --git a/src/services/documents-db.ts b/src/services/documents-db.ts
index 9f60777a..052f9ee4 100644
--- a/src/services/documents-db.ts
+++ b/src/services/documents-db.ts
@@ -17,41 +17,37 @@ export class DocumentsDB {
* Get a list of all databases from the current Appwrite project. You can use the search parameter 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 columns: name
- * @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}
*/
- list(params?: { queries?: string[], search?: string, total?: boolean }): Promise;
+ list(params?: { queries?: string[], total?: boolean }): Promise;
/**
* Get a list of all databases from the current Appwrite project. You can use the search parameter 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 columns: name
- * @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}
* @deprecated Use the object parameter style method for a better developer experience.
*/
- list(queries?: string[], search?: string, total?: boolean): Promise