From 014cdb53b03bd8f97eaa15a8304285213744a5c8 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 24 Mar 2026 13:00:27 +0000 Subject: [PATCH 1/9] feat: update Console SDK to 7.0.0 No user-facing SDK changes --- docs/examples/databases/create-index.md | 4 +- .../examples/documentsdb/create-collection.md | 22 + docs/examples/documentsdb/create-document.md | 25 + docs/examples/documentsdb/create-documents.md | 17 + docs/examples/documentsdb/create-index.md | 21 + .../documentsdb/create-transaction.md | 15 + docs/examples/documentsdb/create.md | 17 + .../decrement-document-attribute.md | 21 + .../examples/documentsdb/delete-collection.md | 16 + docs/examples/documentsdb/delete-document.md | 18 + docs/examples/documentsdb/delete-documents.md | 18 + docs/examples/documentsdb/delete-index.md | 17 + .../documentsdb/delete-transaction.md | 15 + docs/examples/documentsdb/delete.md | 15 + .../documentsdb/get-collection-usage.md | 17 + docs/examples/documentsdb/get-collection.md | 16 + docs/examples/documentsdb/get-document.md | 19 + docs/examples/documentsdb/get-index.md | 17 + docs/examples/documentsdb/get-transaction.md | 15 + docs/examples/documentsdb/get-usage.md | 16 + docs/examples/documentsdb/get.md | 15 + .../increment-document-attribute.md | 21 + .../documentsdb/list-collection-logs.md | 17 + docs/examples/documentsdb/list-collections.md | 18 + .../documentsdb/list-document-logs.md | 18 + docs/examples/documentsdb/list-documents.md | 20 + docs/examples/documentsdb/list-indexes.md | 18 + .../examples/documentsdb/list-transactions.md | 15 + docs/examples/documentsdb/list-usage.md | 15 + docs/examples/documentsdb/list.md | 17 + .../examples/documentsdb/update-collection.md | 20 + docs/examples/documentsdb/update-document.md | 20 + docs/examples/documentsdb/update-documents.md | 19 + .../documentsdb/update-transaction.md | 17 + docs/examples/documentsdb/update.md | 17 + docs/examples/documentsdb/upsert-document.md | 20 + docs/examples/documentsdb/upsert-documents.md | 18 + docs/examples/project/create-variable.md | 1 + docs/examples/project/list-variables.md | 5 +- docs/examples/project/update-variable.md | 2 +- docs/examples/tablesdb/create-index.md | 4 +- docs/examples/users/update-impersonator.md | 16 + docs/examples/vectorsdb/create-collection.md | 21 + docs/examples/vectorsdb/create-document.md | 29 + docs/examples/vectorsdb/create-documents.md | 17 + docs/examples/vectorsdb/create-index.md | 21 + docs/examples/vectorsdb/create-operations.md | 26 + .../vectorsdb/create-text-embeddings.md | 16 + docs/examples/vectorsdb/create-transaction.md | 15 + docs/examples/vectorsdb/create.md | 17 + docs/examples/vectorsdb/delete-collection.md | 16 + docs/examples/vectorsdb/delete-document.md | 18 + docs/examples/vectorsdb/delete-documents.md | 18 + docs/examples/vectorsdb/delete-index.md | 17 + docs/examples/vectorsdb/delete-transaction.md | 15 + docs/examples/vectorsdb/delete.md | 15 + .../vectorsdb/get-collection-usage.md | 17 + docs/examples/vectorsdb/get-collection.md | 16 + docs/examples/vectorsdb/get-document.md | 19 + docs/examples/vectorsdb/get-index.md | 17 + docs/examples/vectorsdb/get-transaction.md | 15 + docs/examples/vectorsdb/get-usage.md | 16 + docs/examples/vectorsdb/get.md | 15 + .../vectorsdb/list-collection-logs.md | 17 + docs/examples/vectorsdb/list-collections.md | 18 + docs/examples/vectorsdb/list-document-logs.md | 18 + docs/examples/vectorsdb/list-documents.md | 20 + docs/examples/vectorsdb/list-indexes.md | 18 + docs/examples/vectorsdb/list-transactions.md | 15 + docs/examples/vectorsdb/list-usage.md | 15 + docs/examples/vectorsdb/list.md | 17 + docs/examples/vectorsdb/update-collection.md | 21 + docs/examples/vectorsdb/update-document.md | 20 + docs/examples/vectorsdb/update-documents.md | 19 + docs/examples/vectorsdb/update-transaction.md | 17 + docs/examples/vectorsdb/update.md | 17 + docs/examples/vectorsdb/upsert-document.md | 20 + docs/examples/vectorsdb/upsert-documents.md | 18 + package.json | 12 +- rollup.config.js | 3 +- src/client.ts | 48 + src/enums/appwrite-migration-resource.ts | 2 + src/enums/backup-services.ts | 3 + src/enums/database-type.ts | 2 + src/enums/databases-index-type.ts | 6 + src/enums/documents-db-index-type.ts | 6 + src/enums/model.ts | 3 + src/enums/scopes.ts | 2 + ...{index-type.ts => tables-db-index-type.ts} | 2 +- src/enums/vectors-db-index-type.ts | 8 + src/index.ts | 8 +- src/models.ts | 486 ++- src/services/databases.ts | 20 +- src/services/documents-db.ts | 2608 +++++++++++++++++ src/services/domains.ts | 24 +- src/services/project.ts | 109 +- src/services/tables-db.ts | 20 +- src/services/users.ts | 69 +- src/services/vectors-db.ts | 2477 ++++++++++++++++ 99 files changed, 7152 insertions(+), 86 deletions(-) create mode 100644 docs/examples/documentsdb/create-collection.md create mode 100644 docs/examples/documentsdb/create-document.md create mode 100644 docs/examples/documentsdb/create-documents.md create mode 100644 docs/examples/documentsdb/create-index.md create mode 100644 docs/examples/documentsdb/create-transaction.md create mode 100644 docs/examples/documentsdb/create.md create mode 100644 docs/examples/documentsdb/decrement-document-attribute.md create mode 100644 docs/examples/documentsdb/delete-collection.md create mode 100644 docs/examples/documentsdb/delete-document.md create mode 100644 docs/examples/documentsdb/delete-documents.md create mode 100644 docs/examples/documentsdb/delete-index.md create mode 100644 docs/examples/documentsdb/delete-transaction.md create mode 100644 docs/examples/documentsdb/delete.md create mode 100644 docs/examples/documentsdb/get-collection-usage.md create mode 100644 docs/examples/documentsdb/get-collection.md create mode 100644 docs/examples/documentsdb/get-document.md create mode 100644 docs/examples/documentsdb/get-index.md create mode 100644 docs/examples/documentsdb/get-transaction.md create mode 100644 docs/examples/documentsdb/get-usage.md create mode 100644 docs/examples/documentsdb/get.md create mode 100644 docs/examples/documentsdb/increment-document-attribute.md create mode 100644 docs/examples/documentsdb/list-collection-logs.md create mode 100644 docs/examples/documentsdb/list-collections.md create mode 100644 docs/examples/documentsdb/list-document-logs.md create mode 100644 docs/examples/documentsdb/list-documents.md create mode 100644 docs/examples/documentsdb/list-indexes.md create mode 100644 docs/examples/documentsdb/list-transactions.md create mode 100644 docs/examples/documentsdb/list-usage.md create mode 100644 docs/examples/documentsdb/list.md create mode 100644 docs/examples/documentsdb/update-collection.md create mode 100644 docs/examples/documentsdb/update-document.md create mode 100644 docs/examples/documentsdb/update-documents.md create mode 100644 docs/examples/documentsdb/update-transaction.md create mode 100644 docs/examples/documentsdb/update.md create mode 100644 docs/examples/documentsdb/upsert-document.md create mode 100644 docs/examples/documentsdb/upsert-documents.md create mode 100644 docs/examples/users/update-impersonator.md create mode 100644 docs/examples/vectorsdb/create-collection.md create mode 100644 docs/examples/vectorsdb/create-document.md create mode 100644 docs/examples/vectorsdb/create-documents.md create mode 100644 docs/examples/vectorsdb/create-index.md create mode 100644 docs/examples/vectorsdb/create-operations.md create mode 100644 docs/examples/vectorsdb/create-text-embeddings.md create mode 100644 docs/examples/vectorsdb/create-transaction.md create mode 100644 docs/examples/vectorsdb/create.md create mode 100644 docs/examples/vectorsdb/delete-collection.md create mode 100644 docs/examples/vectorsdb/delete-document.md create mode 100644 docs/examples/vectorsdb/delete-documents.md create mode 100644 docs/examples/vectorsdb/delete-index.md create mode 100644 docs/examples/vectorsdb/delete-transaction.md create mode 100644 docs/examples/vectorsdb/delete.md create mode 100644 docs/examples/vectorsdb/get-collection-usage.md create mode 100644 docs/examples/vectorsdb/get-collection.md create mode 100644 docs/examples/vectorsdb/get-document.md create mode 100644 docs/examples/vectorsdb/get-index.md create mode 100644 docs/examples/vectorsdb/get-transaction.md create mode 100644 docs/examples/vectorsdb/get-usage.md create mode 100644 docs/examples/vectorsdb/get.md create mode 100644 docs/examples/vectorsdb/list-collection-logs.md create mode 100644 docs/examples/vectorsdb/list-collections.md create mode 100644 docs/examples/vectorsdb/list-document-logs.md create mode 100644 docs/examples/vectorsdb/list-documents.md create mode 100644 docs/examples/vectorsdb/list-indexes.md create mode 100644 docs/examples/vectorsdb/list-transactions.md create mode 100644 docs/examples/vectorsdb/list-usage.md create mode 100644 docs/examples/vectorsdb/list.md create mode 100644 docs/examples/vectorsdb/update-collection.md create mode 100644 docs/examples/vectorsdb/update-document.md create mode 100644 docs/examples/vectorsdb/update-documents.md create mode 100644 docs/examples/vectorsdb/update-transaction.md create mode 100644 docs/examples/vectorsdb/update.md create mode 100644 docs/examples/vectorsdb/upsert-document.md create mode 100644 docs/examples/vectorsdb/upsert-documents.md create mode 100644 src/enums/databases-index-type.ts create mode 100644 src/enums/documents-db-index-type.ts create mode 100644 src/enums/model.ts rename src/enums/{index-type.ts => tables-db-index-type.ts} (74%) create mode 100644 src/enums/vectors-db-index-type.ts create mode 100644 src/services/documents-db.ts create mode 100644 src/services/vectors-db.ts diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 4df9565e..0f5fe9d2 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Databases, IndexType, OrderBy } from "@appwrite.io/console"; +import { Client, Databases, DatabasesIndexType, OrderBy } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,7 @@ const result = await databases.createIndex({ databaseId: '', collectionId: '', key: '', - type: IndexType.Key, + type: DatabasesIndexType.Key, attributes: [], orders: [OrderBy.Asc], // optional lengths: [] // optional diff --git a/docs/examples/documentsdb/create-collection.md b/docs/examples/documentsdb/create-collection.md new file mode 100644 index 00000000..a1312824 --- /dev/null +++ b/docs/examples/documentsdb/create-collection.md @@ -0,0 +1,22 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createCollection({ + databaseId: '', + collectionId: '', + name: '', + permissions: [Permission.read(Role.any())], // optional + documentSecurity: false, // optional + enabled: false, // optional + attributes: [], // optional + indexes: [] // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/create-document.md b/docs/examples/documentsdb/create-document.md new file mode 100644 index 00000000..a628708e --- /dev/null +++ b/docs/examples/documentsdb/create-document.md @@ -0,0 +1,25 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + "username": "walter.obrien", + "email": "walter.obrien@example.com", + "fullName": "Walter O'Brien", + "age": 30, + "isAdmin": false + }, + permissions: [Permission.read(Role.any())] // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/create-documents.md b/docs/examples/documentsdb/create-documents.md new file mode 100644 index 00000000..3880bb7e --- /dev/null +++ b/docs/examples/documentsdb/create-documents.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createDocuments({ + databaseId: '', + collectionId: '', + documents: [] +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/create-index.md b/docs/examples/documentsdb/create-index.md new file mode 100644 index 00000000..d28785a0 --- /dev/null +++ b/docs/examples/documentsdb/create-index.md @@ -0,0 +1,21 @@ +```javascript +import { Client, DocumentsDB, DocumentsDBIndexType, OrderBy } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createIndex({ + databaseId: '', + collectionId: '', + key: '', + type: DocumentsDBIndexType.Key, + attributes: [], + orders: [OrderBy.Asc], // optional + lengths: [] // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/create-transaction.md b/docs/examples/documentsdb/create-transaction.md new file mode 100644 index 00000000..a5854097 --- /dev/null +++ b/docs/examples/documentsdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createTransaction({ + ttl: 60 // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/create.md b/docs/examples/documentsdb/create.md new file mode 100644 index 00000000..a0cc85ab --- /dev/null +++ b/docs/examples/documentsdb/create.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.create({ + databaseId: '', + name: '', + enabled: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/decrement-document-attribute.md b/docs/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 00000000..873df72b --- /dev/null +++ b/docs/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.decrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: null, // optional + min: null, // optional + transactionId: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/delete-collection.md b/docs/examples/documentsdb/delete-collection.md new file mode 100644 index 00000000..708c1e4e --- /dev/null +++ b/docs/examples/documentsdb/delete-collection.md @@ -0,0 +1,16 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteCollection({ + databaseId: '', + collectionId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/delete-document.md b/docs/examples/documentsdb/delete-document.md new file mode 100644 index 00000000..272379d1 --- /dev/null +++ b/docs/examples/documentsdb/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/delete-documents.md b/docs/examples/documentsdb/delete-documents.md new file mode 100644 index 00000000..5aae827f --- /dev/null +++ b/docs/examples/documentsdb/delete-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/delete-index.md b/docs/examples/documentsdb/delete-index.md new file mode 100644 index 00000000..a36bff9f --- /dev/null +++ b/docs/examples/documentsdb/delete-index.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteIndex({ + databaseId: '', + collectionId: '', + key: '' +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/delete-transaction.md b/docs/examples/documentsdb/delete-transaction.md new file mode 100644 index 00000000..a22112d8 --- /dev/null +++ b/docs/examples/documentsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteTransaction({ + transactionId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/delete.md b/docs/examples/documentsdb/delete.md new file mode 100644 index 00000000..40e50d61 --- /dev/null +++ b/docs/examples/documentsdb/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.delete({ + databaseId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/get-collection-usage.md b/docs/examples/documentsdb/get-collection-usage.md new file mode 100644 index 00000000..10c473c8 --- /dev/null +++ b/docs/examples/documentsdb/get-collection-usage.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getCollectionUsage({ + databaseId: '', + collectionId: '', + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/get-collection.md b/docs/examples/documentsdb/get-collection.md new file mode 100644 index 00000000..6179e8c5 --- /dev/null +++ b/docs/examples/documentsdb/get-collection.md @@ -0,0 +1,16 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getCollection({ + databaseId: '', + collectionId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/get-document.md b/docs/examples/documentsdb/get-document.md new file mode 100644 index 00000000..916fe5c2 --- /dev/null +++ b/docs/examples/documentsdb/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/get-index.md b/docs/examples/documentsdb/get-index.md new file mode 100644 index 00000000..0e971cb1 --- /dev/null +++ b/docs/examples/documentsdb/get-index.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getIndex({ + databaseId: '', + collectionId: '', + key: '' +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/get-transaction.md b/docs/examples/documentsdb/get-transaction.md new file mode 100644 index 00000000..18217485 --- /dev/null +++ b/docs/examples/documentsdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getTransaction({ + transactionId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/get-usage.md b/docs/examples/documentsdb/get-usage.md new file mode 100644 index 00000000..79428904 --- /dev/null +++ b/docs/examples/documentsdb/get-usage.md @@ -0,0 +1,16 @@ +```javascript +import { Client, DocumentsDB, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getUsage({ + databaseId: '', + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/get.md b/docs/examples/documentsdb/get.md new file mode 100644 index 00000000..6c1392bd --- /dev/null +++ b/docs/examples/documentsdb/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.get({ + databaseId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/increment-document-attribute.md b/docs/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 00000000..ba4f2e1d --- /dev/null +++ b/docs/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.incrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: null, // optional + max: null, // optional + transactionId: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/list-collection-logs.md b/docs/examples/documentsdb/list-collection-logs.md new file mode 100644 index 00000000..eed2919c --- /dev/null +++ b/docs/examples/documentsdb/list-collection-logs.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listCollectionLogs({ + databaseId: '', + collectionId: '', + queries: [] // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/list-collections.md b/docs/examples/documentsdb/list-collections.md new file mode 100644 index 00000000..340dbd5a --- /dev/null +++ b/docs/examples/documentsdb/list-collections.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listCollections({ + databaseId: '', + queries: [], // optional + search: '', // optional + total: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/list-document-logs.md b/docs/examples/documentsdb/list-document-logs.md new file mode 100644 index 00000000..25897c11 --- /dev/null +++ b/docs/examples/documentsdb/list-document-logs.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listDocumentLogs({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [] // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/list-documents.md b/docs/examples/documentsdb/list-documents.md new file mode 100644 index 00000000..fc9d443f --- /dev/null +++ b/docs/examples/documentsdb/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0 // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/list-indexes.md b/docs/examples/documentsdb/list-indexes.md new file mode 100644 index 00000000..43891aca --- /dev/null +++ b/docs/examples/documentsdb/list-indexes.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listIndexes({ + databaseId: '', + collectionId: '', + queries: [], // optional + total: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/list-transactions.md b/docs/examples/documentsdb/list-transactions.md new file mode 100644 index 00000000..6a291601 --- /dev/null +++ b/docs/examples/documentsdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listTransactions({ + queries: [] // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/list-usage.md b/docs/examples/documentsdb/list-usage.md new file mode 100644 index 00000000..300192ea --- /dev/null +++ b/docs/examples/documentsdb/list-usage.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listUsage({ + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/list.md b/docs/examples/documentsdb/list.md new file mode 100644 index 00000000..fa0cd866 --- /dev/null +++ b/docs/examples/documentsdb/list.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.list({ + queries: [], // optional + search: '', // optional + total: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/update-collection.md b/docs/examples/documentsdb/update-collection.md new file mode 100644 index 00000000..d0eb689c --- /dev/null +++ b/docs/examples/documentsdb/update-collection.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateCollection({ + databaseId: '', + collectionId: '', + name: '', + permissions: [Permission.read(Role.any())], // optional + documentSecurity: false, // optional + enabled: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/update-document.md b/docs/examples/documentsdb/update-document.md new file mode 100644 index 00000000..66d09372 --- /dev/null +++ b/docs/examples/documentsdb/update-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/update-documents.md b/docs/examples/documentsdb/update-documents.md new file mode 100644 index 00000000..f41af221 --- /dev/null +++ b/docs/examples/documentsdb/update-documents.md @@ -0,0 +1,19 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateDocuments({ + databaseId: '', + collectionId: '', + data: {}, // optional + queries: [], // optional + transactionId: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/update-transaction.md b/docs/examples/documentsdb/update-transaction.md new file mode 100644 index 00000000..1c4daa45 --- /dev/null +++ b/docs/examples/documentsdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/update.md b/docs/examples/documentsdb/update.md new file mode 100644 index 00000000..24be2117 --- /dev/null +++ b/docs/examples/documentsdb/update.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.update({ + databaseId: '', + name: '', + enabled: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/upsert-document.md b/docs/examples/documentsdb/upsert-document.md new file mode 100644 index 00000000..465d1bac --- /dev/null +++ b/docs/examples/documentsdb/upsert-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/upsert-documents.md b/docs/examples/documentsdb/upsert-documents.md new file mode 100644 index 00000000..d67e350a --- /dev/null +++ b/docs/examples/documentsdb/upsert-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.upsertDocuments({ + databaseId: '', + collectionId: '', + documents: [], + transactionId: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/project/create-variable.md b/docs/examples/project/create-variable.md index c788af94..c27a58dd 100644 --- a/docs/examples/project/create-variable.md +++ b/docs/examples/project/create-variable.md @@ -8,6 +8,7 @@ const client = new Client() const project = new Project(client); const result = await project.createVariable({ + variableId: '', key: '', value: '', secret: false // optional diff --git a/docs/examples/project/list-variables.md b/docs/examples/project/list-variables.md index ec14f99c..52cdb733 100644 --- a/docs/examples/project/list-variables.md +++ b/docs/examples/project/list-variables.md @@ -7,7 +7,10 @@ const client = new Client() const project = new Project(client); -const result = await project.listVariables(); +const result = await project.listVariables({ + queries: [], // optional + total: false // optional +}); console.log(result); ``` diff --git a/docs/examples/project/update-variable.md b/docs/examples/project/update-variable.md index 8d22cd0b..2eedd902 100644 --- a/docs/examples/project/update-variable.md +++ b/docs/examples/project/update-variable.md @@ -9,7 +9,7 @@ const project = new Project(client); const result = await project.updateVariable({ variableId: '', - key: '', + key: '', // optional value: '', // optional secret: false // optional }); diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md index 648f033d..aa5aa3e4 100644 --- a/docs/examples/tablesdb/create-index.md +++ b/docs/examples/tablesdb/create-index.md @@ -1,5 +1,5 @@ ```javascript -import { Client, TablesDB, IndexType, OrderBy } from "@appwrite.io/console"; +import { Client, TablesDB, TablesDBIndexType, OrderBy } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,7 @@ const result = await tablesDB.createIndex({ databaseId: '', tableId: '', key: '', - type: IndexType.Key, + type: TablesDBIndexType.Key, columns: [], orders: [OrderBy.Asc], // optional lengths: [] // optional diff --git a/docs/examples/users/update-impersonator.md b/docs/examples/users/update-impersonator.md new file mode 100644 index 00000000..955af032 --- /dev/null +++ b/docs/examples/users/update-impersonator.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const users = new Users(client); + +const result = await users.updateImpersonator({ + userId: '', + impersonator: false +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/create-collection.md b/docs/examples/vectorsdb/create-collection.md new file mode 100644 index 00000000..43924d6b --- /dev/null +++ b/docs/examples/vectorsdb/create-collection.md @@ -0,0 +1,21 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createCollection({ + databaseId: '', + collectionId: '', + name: '', + dimension: 1, + permissions: [Permission.read(Role.any())], // optional + documentSecurity: false, // optional + enabled: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/create-document.md b/docs/examples/vectorsdb/create-document.md new file mode 100644 index 00000000..85067168 --- /dev/null +++ b/docs/examples/vectorsdb/create-document.md @@ -0,0 +1,29 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + "embeddings": [ + 0.12, + -0.55, + 0.88, + 1.02 + ], + "metadata": { + "key": "value" + } + }, + permissions: [Permission.read(Role.any())] // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/create-documents.md b/docs/examples/vectorsdb/create-documents.md new file mode 100644 index 00000000..4f955e88 --- /dev/null +++ b/docs/examples/vectorsdb/create-documents.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createDocuments({ + databaseId: '', + collectionId: '', + documents: [] +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/create-index.md b/docs/examples/vectorsdb/create-index.md new file mode 100644 index 00000000..7bef86ed --- /dev/null +++ b/docs/examples/vectorsdb/create-index.md @@ -0,0 +1,21 @@ +```javascript +import { Client, VectorsDB, VectorsDBIndexType, OrderBy } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createIndex({ + databaseId: '', + collectionId: '', + key: '', + type: VectorsDBIndexType.HnswEuclidean, + attributes: [], + orders: [OrderBy.Asc], // optional + lengths: [] // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/create-operations.md b/docs/examples/vectorsdb/create-operations.md new file mode 100644 index 00000000..5ff5f687 --- /dev/null +++ b/docs/examples/vectorsdb/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createOperations({ + transactionId: '', + operations: [ + { + "action": "create", + "databaseId": "", + "collectionId": "", + "documentId": "", + "data": { + "name": "Walter O'Brien" + } + } + ] // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/create-text-embeddings.md b/docs/examples/vectorsdb/create-text-embeddings.md new file mode 100644 index 00000000..e024b563 --- /dev/null +++ b/docs/examples/vectorsdb/create-text-embeddings.md @@ -0,0 +1,16 @@ +```javascript +import { Client, VectorsDB, Model } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createTextEmbeddings({ + texts: [], + model: Model.Embeddinggemma // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/create-transaction.md b/docs/examples/vectorsdb/create-transaction.md new file mode 100644 index 00000000..99ee2ff6 --- /dev/null +++ b/docs/examples/vectorsdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createTransaction({ + ttl: 60 // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/create.md b/docs/examples/vectorsdb/create.md new file mode 100644 index 00000000..d37467a0 --- /dev/null +++ b/docs/examples/vectorsdb/create.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.create({ + databaseId: '', + name: '', + enabled: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/delete-collection.md b/docs/examples/vectorsdb/delete-collection.md new file mode 100644 index 00000000..bc7997f9 --- /dev/null +++ b/docs/examples/vectorsdb/delete-collection.md @@ -0,0 +1,16 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteCollection({ + databaseId: '', + collectionId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/delete-document.md b/docs/examples/vectorsdb/delete-document.md new file mode 100644 index 00000000..a1db5dea --- /dev/null +++ b/docs/examples/vectorsdb/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/delete-documents.md b/docs/examples/vectorsdb/delete-documents.md new file mode 100644 index 00000000..92d6c8a6 --- /dev/null +++ b/docs/examples/vectorsdb/delete-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/delete-index.md b/docs/examples/vectorsdb/delete-index.md new file mode 100644 index 00000000..b592d682 --- /dev/null +++ b/docs/examples/vectorsdb/delete-index.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteIndex({ + databaseId: '', + collectionId: '', + key: '' +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/delete-transaction.md b/docs/examples/vectorsdb/delete-transaction.md new file mode 100644 index 00000000..12a21357 --- /dev/null +++ b/docs/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteTransaction({ + transactionId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/delete.md b/docs/examples/vectorsdb/delete.md new file mode 100644 index 00000000..768bf7bc --- /dev/null +++ b/docs/examples/vectorsdb/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.delete({ + databaseId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/get-collection-usage.md b/docs/examples/vectorsdb/get-collection-usage.md new file mode 100644 index 00000000..b41c7ab2 --- /dev/null +++ b/docs/examples/vectorsdb/get-collection-usage.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getCollectionUsage({ + databaseId: '', + collectionId: '', + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/get-collection.md b/docs/examples/vectorsdb/get-collection.md new file mode 100644 index 00000000..440adca2 --- /dev/null +++ b/docs/examples/vectorsdb/get-collection.md @@ -0,0 +1,16 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getCollection({ + databaseId: '', + collectionId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/get-document.md b/docs/examples/vectorsdb/get-document.md new file mode 100644 index 00000000..c3ecc577 --- /dev/null +++ b/docs/examples/vectorsdb/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/get-index.md b/docs/examples/vectorsdb/get-index.md new file mode 100644 index 00000000..08930cfe --- /dev/null +++ b/docs/examples/vectorsdb/get-index.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getIndex({ + databaseId: '', + collectionId: '', + key: '' +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/get-transaction.md b/docs/examples/vectorsdb/get-transaction.md new file mode 100644 index 00000000..80c1ab82 --- /dev/null +++ b/docs/examples/vectorsdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getTransaction({ + transactionId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/get-usage.md b/docs/examples/vectorsdb/get-usage.md new file mode 100644 index 00000000..91bf3b29 --- /dev/null +++ b/docs/examples/vectorsdb/get-usage.md @@ -0,0 +1,16 @@ +```javascript +import { Client, VectorsDB, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getUsage({ + databaseId: '', + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/get.md b/docs/examples/vectorsdb/get.md new file mode 100644 index 00000000..b7c5f5ac --- /dev/null +++ b/docs/examples/vectorsdb/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.get({ + databaseId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/list-collection-logs.md b/docs/examples/vectorsdb/list-collection-logs.md new file mode 100644 index 00000000..c997889b --- /dev/null +++ b/docs/examples/vectorsdb/list-collection-logs.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listCollectionLogs({ + databaseId: '', + collectionId: '', + queries: [] // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/list-collections.md b/docs/examples/vectorsdb/list-collections.md new file mode 100644 index 00000000..dd4f27fb --- /dev/null +++ b/docs/examples/vectorsdb/list-collections.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listCollections({ + databaseId: '', + queries: [], // optional + search: '', // optional + total: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/list-document-logs.md b/docs/examples/vectorsdb/list-document-logs.md new file mode 100644 index 00000000..5dd3e626 --- /dev/null +++ b/docs/examples/vectorsdb/list-document-logs.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listDocumentLogs({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [] // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/list-documents.md b/docs/examples/vectorsdb/list-documents.md new file mode 100644 index 00000000..8b907aad --- /dev/null +++ b/docs/examples/vectorsdb/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0 // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/list-indexes.md b/docs/examples/vectorsdb/list-indexes.md new file mode 100644 index 00000000..eeeddb5c --- /dev/null +++ b/docs/examples/vectorsdb/list-indexes.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listIndexes({ + databaseId: '', + collectionId: '', + queries: [], // optional + total: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/list-transactions.md b/docs/examples/vectorsdb/list-transactions.md new file mode 100644 index 00000000..21edf97c --- /dev/null +++ b/docs/examples/vectorsdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listTransactions({ + queries: [] // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/list-usage.md b/docs/examples/vectorsdb/list-usage.md new file mode 100644 index 00000000..75f0eb0b --- /dev/null +++ b/docs/examples/vectorsdb/list-usage.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB, UsageRange } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listUsage({ + range: UsageRange.TwentyFourHours // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/list.md b/docs/examples/vectorsdb/list.md new file mode 100644 index 00000000..e7649d01 --- /dev/null +++ b/docs/examples/vectorsdb/list.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.list({ + queries: [], // optional + search: '', // optional + total: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/update-collection.md b/docs/examples/vectorsdb/update-collection.md new file mode 100644 index 00000000..2cbc7d5a --- /dev/null +++ b/docs/examples/vectorsdb/update-collection.md @@ -0,0 +1,21 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateCollection({ + databaseId: '', + collectionId: '', + name: '', + dimension: 1, // optional + permissions: [Permission.read(Role.any())], // optional + documentSecurity: false, // optional + enabled: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/update-document.md b/docs/examples/vectorsdb/update-document.md new file mode 100644 index 00000000..ce990ad6 --- /dev/null +++ b/docs/examples/vectorsdb/update-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/update-documents.md b/docs/examples/vectorsdb/update-documents.md new file mode 100644 index 00000000..44c19fb4 --- /dev/null +++ b/docs/examples/vectorsdb/update-documents.md @@ -0,0 +1,19 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateDocuments({ + databaseId: '', + collectionId: '', + data: {}, // optional + queries: [], // optional + transactionId: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/update-transaction.md b/docs/examples/vectorsdb/update-transaction.md new file mode 100644 index 00000000..a7809df7 --- /dev/null +++ b/docs/examples/vectorsdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/update.md b/docs/examples/vectorsdb/update.md new file mode 100644 index 00000000..c0fc980b --- /dev/null +++ b/docs/examples/vectorsdb/update.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.update({ + databaseId: '', + name: '', + enabled: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/upsert-document.md b/docs/examples/vectorsdb/upsert-document.md new file mode 100644 index 00000000..1221bad1 --- /dev/null +++ b/docs/examples/vectorsdb/upsert-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/upsert-documents.md b/docs/examples/vectorsdb/upsert-documents.md new file mode 100644 index 00000000..74a03f92 --- /dev/null +++ b/docs/examples/vectorsdb/upsert-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.upsertDocuments({ + databaseId: '', + collectionId: '', + documents: [], + transactionId: '' // optional +}); + +console.log(result); +``` diff --git a/package.json b/package.json index 2b6e924a..7a3ec73a 100644 --- a/package.json +++ b/package.json @@ -28,15 +28,15 @@ "json-bigint": "1.0.0" }, "devDependencies": { - "@rollup/plugin-commonjs": "22.0.0", - "@rollup/plugin-node-resolve": "13.3.0", - "@rollup/plugin-typescript": "8.3.2", + "@rollup/plugin-commonjs": "25.0.8", + "@rollup/plugin-node-resolve": "15.3.1", + "@rollup/plugin-typescript": "11.1.6", "@types/json-bigint": "1.0.4", "playwright": "1.56.1", - "rollup": "2.79.2", + "rollup": "3.29.5", "serve-handler": "6.1.0", - "tslib": "2.4.0", - "typescript": "4.7.2" + "tslib": "2.8.1", + "typescript": "5.7.3" }, "jsdelivr": "dist/iife/sdk.js", "unpkg": "dist/iife/sdk.js" diff --git a/rollup.config.js b/rollup.config.js index a02bbc3e..72a093a3 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,4 +1,5 @@ -import pkg from "./package.json"; +import { readFileSync } from "fs"; +const pkg = JSON.parse(readFileSync("./package.json", "utf8")); import typescript from "@rollup/plugin-typescript"; import resolve from "@rollup/plugin-node-resolve"; import commonjs from "@rollup/plugin-commonjs"; diff --git a/src/client.ts b/src/client.ts index 7a62d359..582c9e1e 100644 --- a/src/client.ts +++ b/src/client.ts @@ -377,6 +377,9 @@ class Client { locale: string; mode: string; cookie: string; + impersonateuserid: string; + impersonateuseremail: string; + impersonateuserphone: string; platform: string; selfSigned: boolean; session?: string; @@ -389,6 +392,9 @@ class Client { locale: '', mode: '', cookie: '', + impersonateuserid: '', + impersonateuseremail: '', + impersonateuserphone: '', platform: '', selfSigned: false, session: undefined, @@ -540,6 +546,48 @@ class Client { this.config.cookie = value; return this; } + /** + * Set ImpersonateUserId + * + * Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. + * + * @param value string + * + * @return {this} + */ + setImpersonateUserId(value: string): this { + this.headers['X-Appwrite-Impersonate-User-Id'] = value; + this.config.impersonateuserid = value; + return this; + } + /** + * Set ImpersonateUserEmail + * + * Impersonate a user by email on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. + * + * @param value string + * + * @return {this} + */ + setImpersonateUserEmail(value: string): this { + this.headers['X-Appwrite-Impersonate-User-Email'] = value; + this.config.impersonateuseremail = value; + return this; + } + /** + * Set ImpersonateUserPhone + * + * Impersonate a user by phone on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. + * + * @param value string + * + * @return {this} + */ + setImpersonateUserPhone(value: string): this { + this.headers['X-Appwrite-Impersonate-User-Phone'] = value; + this.config.impersonateuserphone = value; + return this; + } /** * Set Platform * diff --git a/src/enums/appwrite-migration-resource.ts b/src/enums/appwrite-migration-resource.ts index 30284bbe..bd3a26bc 100644 --- a/src/enums/appwrite-migration-resource.ts +++ b/src/enums/appwrite-migration-resource.ts @@ -10,6 +10,8 @@ export enum AppwriteMigrationResource { Document = 'document', Attribute = 'attribute', Collection = 'collection', + Documentsdb = 'documentsdb', + Vectorsdb = 'vectorsdb', Bucket = 'bucket', File = 'file', Function = 'function', diff --git a/src/enums/backup-services.ts b/src/enums/backup-services.ts index f0f829ab..bd0582ce 100644 --- a/src/enums/backup-services.ts +++ b/src/enums/backup-services.ts @@ -1,5 +1,8 @@ export enum BackupServices { Databases = 'databases', + Tablesdb = 'tablesdb', + Documentsdb = 'documentsdb', + Vectorsdb = 'vectorsdb', Functions = 'functions', Storage = 'storage', } \ No newline at end of file diff --git a/src/enums/database-type.ts b/src/enums/database-type.ts index 71d1ed9d..8ccd9699 100644 --- a/src/enums/database-type.ts +++ b/src/enums/database-type.ts @@ -1,4 +1,6 @@ export enum DatabaseType { Legacy = 'legacy', Tablesdb = 'tablesdb', + Documentsdb = 'documentsdb', + Vectorsdb = 'vectorsdb', } \ No newline at end of file diff --git a/src/enums/databases-index-type.ts b/src/enums/databases-index-type.ts new file mode 100644 index 00000000..85ccf867 --- /dev/null +++ b/src/enums/databases-index-type.ts @@ -0,0 +1,6 @@ +export enum DatabasesIndexType { + Key = 'key', + Fulltext = 'fulltext', + Unique = 'unique', + Spatial = 'spatial', +} \ No newline at end of file diff --git a/src/enums/documents-db-index-type.ts b/src/enums/documents-db-index-type.ts new file mode 100644 index 00000000..8b65e173 --- /dev/null +++ b/src/enums/documents-db-index-type.ts @@ -0,0 +1,6 @@ +export enum DocumentsDBIndexType { + Key = 'key', + Fulltext = 'fulltext', + Unique = 'unique', + Spatial = 'spatial', +} \ No newline at end of file diff --git a/src/enums/model.ts b/src/enums/model.ts new file mode 100644 index 00000000..78e605e3 --- /dev/null +++ b/src/enums/model.ts @@ -0,0 +1,3 @@ +export enum Model { + Embeddinggemma = 'embeddinggemma', +} \ No newline at end of file diff --git a/src/enums/scopes.ts b/src/enums/scopes.ts index cd8f0474..d85b2bb5 100644 --- a/src/enums/scopes.ts +++ b/src/enums/scopes.ts @@ -58,6 +58,8 @@ export enum Scopes { TokensWrite = 'tokens.write', WebhooksRead = 'webhooks.read', WebhooksWrite = 'webhooks.write', + ProjectRead = 'project.read', + ProjectWrite = 'project.write', PoliciesWrite = 'policies.write', PoliciesRead = 'policies.read', ArchivesRead = 'archives.read', diff --git a/src/enums/index-type.ts b/src/enums/tables-db-index-type.ts similarity index 74% rename from src/enums/index-type.ts rename to src/enums/tables-db-index-type.ts index e5b5bbab..a199cd9c 100644 --- a/src/enums/index-type.ts +++ b/src/enums/tables-db-index-type.ts @@ -1,4 +1,4 @@ -export enum IndexType { +export enum TablesDBIndexType { Key = 'key', Fulltext = 'fulltext', Unique = 'unique', diff --git a/src/enums/vectors-db-index-type.ts b/src/enums/vectors-db-index-type.ts new file mode 100644 index 00000000..a38d5ea1 --- /dev/null +++ b/src/enums/vectors-db-index-type.ts @@ -0,0 +1,8 @@ +export enum VectorsDBIndexType { + HnswEuclidean = 'hnsw_euclidean', + HnswDot = 'hnsw_dot', + HnswCosine = 'hnsw_cosine', + Object = 'object', + Key = 'key', + Unique = 'unique', +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index a452a5a5..72466350 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,6 +13,7 @@ export { Backups } from './services/backups'; export { Assistant } from './services/assistant'; export { Console } from './services/console'; export { Databases } from './services/databases'; +export { DocumentsDB } from './services/documents-db'; export { Domains } from './services/domains'; export { Functions } from './services/functions'; export { Graphql } from './services/graphql'; @@ -31,6 +32,7 @@ export { Teams } from './services/teams'; export { Tokens } from './services/tokens'; export { Users } from './services/users'; export { Vcs } from './services/vcs'; +export { VectorsDB } from './services/vectors-db'; export { Webhooks } from './services/webhooks'; export { Realtime } from './services/realtime'; export type { Models, Payload, RealtimeResponseEvent, UploadProgress } from './client'; @@ -58,8 +60,9 @@ export { ConsoleResourceType } from './enums/console-resource-type'; export { UsageRange } from './enums/usage-range'; export { RelationshipType } from './enums/relationship-type'; export { RelationMutate } from './enums/relation-mutate'; -export { IndexType } from './enums/index-type'; +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'; @@ -97,9 +100,12 @@ export { Adapter } from './enums/adapter'; export { Frameworks } from './enums/frameworks'; 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 { VectorsDBIndexType } from './enums/vectors-db-index-type'; export { DatabaseType } from './enums/database-type'; export { AttributeStatus } from './enums/attribute-status'; export { ColumnStatus } from './enums/column-status'; diff --git a/src/models.ts b/src/models.ts index 7018c1e5..bafa73b3 100644 --- a/src/models.ts +++ b/src/models.ts @@ -750,6 +750,34 @@ export namespace Models { contents: VcsContent[]; } + /** + * VectorsDB Collections List + */ + export type VectorsdbCollectionList = { + /** + * Total number of collections that matched your query. + */ + total: number; + /** + * List of collections. + */ + collections: VectorsdbCollection[]; + } + + /** + * Embedding list + */ + export type EmbeddingList = { + /** + * Total number of embeddings that matched your query. + */ + total: number; + /** + * List of embeddings. + */ + embeddings: Embedding[]; + } + /** * Database */ @@ -788,6 +816,28 @@ export namespace Models { archives: Collection[]; } + /** + * Embedding + */ + export type Embedding = { + /** + * Embedding model used to generate embeddings. + */ + model: string; + /** + * Number of dimensions for each embedding vector. + */ + dimension: number; + /** + * Embedding vector values. If an error occurs, this will be an empty array. + */ + embedding: number[]; + /** + * Error message if embedding generation fails. Empty string if no error. + */ + error: string; + } + /** * Collection */ @@ -1658,6 +1708,302 @@ export namespace Models { encrypt?: boolean; } + /** + * UsageDocumentsDB + */ + export type UsageDocumentsDB = { + /** + * Time range of the usage stats. + */ + range: string; + /** + * Total aggregated number of collections. + */ + collectionsTotal: number; + /** + * Total aggregated number of documents. + */ + documentsTotal: number; + /** + * Total aggregated storage used in bytes. + */ + storageTotal: number; + /** + * Total number of database reads. + */ + databaseReadsTotal: number; + /** + * Total number of database writes. + */ + databaseWritesTotal: number; + /** + * Aggregated number of collections per period. + */ + collections: Metric[]; + /** + * Aggregated number of documents per period. + */ + documents: Metric[]; + /** + * Aggregated storage used in bytes per period. + */ + storage: Metric[]; + /** + * An array of aggregated number of database reads. + */ + databaseReads: Metric[]; + /** + * An array of aggregated number of database writes. + */ + databaseWrites: Metric[]; + } + + /** + * VectorsDB Collection + */ + export type VectorsdbCollection = { + /** + * Collection ID. + */ + $id: string; + /** + * Collection creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Collection update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Collection permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + */ + $permissions: string[]; + /** + * Database ID. + */ + databaseId: string; + /** + * Collection name. + */ + name: string; + /** + * Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys. + */ + enabled: boolean; + /** + * Whether document-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). + */ + documentSecurity: boolean; + /** + * Collection attributes. + */ + attributes: (Models.AttributeObject | Models.AttributeVector)[]; + /** + * Collection indexes. + */ + indexes: Index[]; + /** + * Maximum document size in bytes. Returns 0 when no limit applies. + */ + bytesMax: number; + /** + * Currently used document size in bytes based on defined attributes. + */ + bytesUsed: number; + /** + * Embedding dimension. + */ + dimension: number; + } + + /** + * AttributeObject + */ + export type AttributeObject = { + /** + * Attribute Key. + */ + key: string; + /** + * Attribute type. + */ + type: string; + /** + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: AttributeStatus; + /** + * Error message. Displays error generated on failure of creating or deleting an attribute. + */ + error: string; + /** + * Is attribute required? + */ + required: boolean; + /** + * Is attribute an array? + */ + array?: boolean; + /** + * Attribute creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Attribute update date in ISO 8601 format. + */ + $updatedAt: string; + } + + /** + * AttributeVector + */ + export type AttributeVector = { + /** + * Attribute Key. + */ + key: string; + /** + * Attribute type. + */ + type: string; + /** + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: AttributeStatus; + /** + * Error message. Displays error generated on failure of creating or deleting an attribute. + */ + error: string; + /** + * Is attribute required? + */ + required: boolean; + /** + * Is attribute an array? + */ + array?: boolean; + /** + * Attribute creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Attribute update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Vector dimensions. + */ + size: number; + } + + /** + * UsageVectorsDBs + */ + export type UsageVectorsDBs = { + /** + * Time range of the usage stats. + */ + range: string; + /** + * Total aggregated number of VectorsDB databases. + */ + databasesTotal: number; + /** + * Total aggregated number of collections. + */ + collectionsTotal: number; + /** + * Total aggregated number of documents. + */ + documentsTotal: number; + /** + * Total aggregated storage in bytes. + */ + storageTotal: number; + /** + * Total number of database reads. + */ + databasesReadsTotal: number; + /** + * Total number of database writes. + */ + databasesWritesTotal: number; + /** + * Aggregated number of databases per period. + */ + databases: Metric[]; + /** + * Aggregated number of collections per period. + */ + collections: Metric[]; + /** + * Aggregated number of documents per period. + */ + documents: Metric[]; + /** + * Aggregated storage in bytes per period. + */ + storage: Metric[]; + /** + * An array of aggregated number of database reads. + */ + databasesReads: Metric[]; + /** + * An array of aggregated number of database writes. + */ + databasesWrites: Metric[]; + } + + /** + * UsageVectorsDB + */ + export type UsageVectorsDB = { + /** + * Time range of the usage stats. + */ + range: string; + /** + * Total aggregated number of collections. + */ + collectionsTotal: number; + /** + * Total aggregated number of documents. + */ + documentsTotal: number; + /** + * Total aggregated storage used in bytes. + */ + storageTotal: number; + /** + * Total number of database reads. + */ + databaseReadsTotal: number; + /** + * Total number of database writes. + */ + databaseWritesTotal: number; + /** + * Aggregated number of collections per period. + */ + collections: Metric[]; + /** + * Aggregated number of documents per period. + */ + documents: Metric[]; + /** + * Aggregated storage used in bytes per period. + */ + storage: Metric[]; + /** + * An array of aggregated number of database reads. + */ + databaseReads: Metric[]; + /** + * An array of aggregated number of database writes. + */ + databaseWrites: Metric[]; + } + /** * Table */ @@ -2707,15 +3053,15 @@ export namespace Models { */ event: string; /** - * User ID. + * User ID of the actor recorded for this log. During impersonation, this is the original impersonator, not the impersonated target user. */ userId: string; /** - * User Email. + * User email of the actor recorded for this log. During impersonation, this is the original impersonator. */ userEmail: string; /** - * User Name. + * User name of the actor recorded for this log. During impersonation, this is the original impersonator. */ userName: string; /** @@ -2868,6 +3214,14 @@ export namespace Models { * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. */ accessedAt: string; + /** + * Whether the user can impersonate other users. + */ + impersonator?: boolean; + /** + * ID of the original actor performing the impersonation. Present only when the current request is impersonating another user. Internal audit logs attribute the action to this user, while the impersonated target is recorded only in internal audit payload data. + */ + impersonatorUserId?: string; } /** @@ -6034,9 +6388,13 @@ export namespace Models { */ executionsTotal: number; /** - * Total aggregated number of documents. + * Total aggregated number of documents in legacy/tablesdb. */ documentsTotal: number; + /** + * Total aggregated number of documents in documentsdb. + */ + documentsdbDocumentsTotal: number; /** * Total aggregated number of rows. */ @@ -6045,10 +6403,18 @@ export namespace Models { * Total aggregated number of databases. */ databasesTotal: number; + /** + * Total aggregated number of documentsdb. + */ + documentsdbTotal: number; /** * Total aggregated sum of databases storage size (in bytes). */ databasesStorageTotal: number; + /** + * Total aggregated sum of documentsdb databases storage size (in bytes). + */ + documentsdbDatabasesStorageTotal: number; /** * Total aggregated number of users. */ @@ -6089,6 +6455,14 @@ export namespace Models { * Aggregated stats for total databases writes. */ databasesWritesTotal: number; + /** + * Total number of documentsdb databases reads. + */ + documentsdbDatabasesReadsTotal: number; + /** + * Total number of documentsdb databases writes. + */ + documentsdbDatabasesWritesTotal: number; /** * Aggregated number of requests per period. */ @@ -6149,6 +6523,18 @@ export namespace Models { * Aggregated stats for database writes. */ databasesWrites: Metric[]; + /** + * An array of aggregated number of documentsdb database reads. + */ + documentsdbDatabasesReads: Metric[]; + /** + * An array of aggregated number of documentsdb database writes. + */ + documentsdbDatabasesWrites: Metric[]; + /** + * An array of aggregated sum of documentsdb databases storage size (in bytes) per period. + */ + documentsdbDatabasesStorage: Metric[]; /** * An array of aggregated number of image transformations. */ @@ -6157,6 +6543,86 @@ export namespace Models { * Total aggregated number of image transformations. */ imageTransformationsTotal: number; + /** + * Total aggregated number of VectorsDB databases. + */ + vectorsdbDatabasesTotal: number; + /** + * Total aggregated number of VectorsDB collections. + */ + vectorsdbCollectionsTotal: number; + /** + * Total aggregated number of VectorsDB documents. + */ + vectorsdbDocumentsTotal: number; + /** + * Total aggregated VectorsDB storage (bytes). + */ + vectorsdbDatabasesStorageTotal: number; + /** + * Total aggregated number of VectorsDB reads. + */ + vectorsdbDatabasesReadsTotal: number; + /** + * Total aggregated number of VectorsDB writes. + */ + vectorsdbDatabasesWritesTotal: number; + /** + * Aggregated VectorsDB databases per period. + */ + vectorsdbDatabases: Metric[]; + /** + * Aggregated VectorsDB collections per period. + */ + vectorsdbCollections: Metric[]; + /** + * Aggregated VectorsDB documents per period. + */ + vectorsdbDocuments: Metric[]; + /** + * Aggregated VectorsDB storage per period. + */ + vectorsdbDatabasesStorage: Metric[]; + /** + * Aggregated VectorsDB reads per period. + */ + vectorsdbDatabasesReads: Metric[]; + /** + * Aggregated VectorsDB writes per period. + */ + vectorsdbDatabasesWrites: Metric[]; + /** + * Aggregated number of text embedding calls per period. + */ + embeddingsText: Metric; + /** + * Aggregated number of tokens processed by text embeddings per period. + */ + embeddingsTextTokens: Metric; + /** + * Aggregated duration spent generating text embeddings per period. + */ + embeddingsTextDuration: Metric; + /** + * Aggregated number of errors while generating text embeddings per period. + */ + embeddingsTextErrors: Metric; + /** + * Total aggregated number of text embedding calls. + */ + embeddingsTextTotal: Metric; + /** + * Total aggregated number of tokens processed by text. + */ + embeddingsTextTokensTotal: Metric; + /** + * Total aggregated duration spent generating text embeddings. + */ + embeddingsTextDurationTotal: Metric; + /** + * Total aggregated number of errors while generating text embeddings. + */ + embeddingsTextErrorsTotal: Metric; /** * Aggregated number of function executions per period. */ @@ -7497,6 +7963,10 @@ export namespace Models { * Realtime connections */ realtime: number; + /** + * Realtime messages + */ + realtimeMessages: number; /** * Messages per month */ @@ -8917,6 +9387,14 @@ export namespace Models { * Realtime additional resources */ realtime: AdditionalResource; + /** + * Realtime messages additional resources + */ + realtimeMessages: AdditionalResource; + /** + * Realtime bandwidth additional resources + */ + realtimeBandwidth: AdditionalResource; /** * Storage additional resources */ diff --git a/src/services/databases.ts b/src/services/databases.ts index ff923c5e..ce8902e3 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -5,7 +5,7 @@ import type { Models } from '../models'; import { UsageRange } from '../enums/usage-range'; import { RelationshipType } from '../enums/relationship-type'; import { RelationMutate } from '../enums/relation-mutate'; -import { IndexType } from '../enums/index-type'; +import { DatabasesIndexType } from '../enums/databases-index-type'; import { OrderBy } from '../enums/order-by'; export class Databases { @@ -5885,7 +5885,7 @@ export class Databases { * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Index Key. - * @param {IndexType} params.type - Index type. + * @param {DatabasesIndexType} params.type - Index type. * @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. * @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed. * @param {number[]} params.lengths - Length of index. Maximum of 100 @@ -5893,7 +5893,7 @@ export class Databases { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createIndex` instead. */ - createIndex(params: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }): Promise; + createIndex(params: { databaseId: string, collectionId: string, key: string, type: DatabasesIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }): Promise; /** * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. * Attributes can be `key`, `fulltext`, and `unique`. @@ -5901,7 +5901,7 @@ export class Databases { * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Index Key. - * @param {IndexType} type - Index type. + * @param {DatabasesIndexType} type - Index type. * @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. * @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed. * @param {number[]} lengths - Length of index. Maximum of 100 @@ -5909,21 +5909,21 @@ export class Databases { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: OrderBy[], lengths?: number[]): Promise; + createIndex(databaseId: string, collectionId: string, key: string, type: DatabasesIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[]): Promise; createIndex( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] } | string, - ...rest: [(string)?, (string)?, (IndexType)?, (string[])?, (OrderBy[])?, (number[])?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, type: DatabasesIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] } | string, + ...rest: [(string)?, (string)?, (DatabasesIndexType)?, (string[])?, (OrderBy[])?, (number[])?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }; + let params: { databaseId: string, collectionId: string, key: string, type: DatabasesIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, type: DatabasesIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, - type: rest[2] as IndexType, + type: rest[2] as DatabasesIndexType, attributes: rest[3] as string[], orders: rest[4] as OrderBy[], lengths: rest[5] as number[] diff --git a/src/services/documents-db.ts b/src/services/documents-db.ts new file mode 100644 index 00000000..158dee86 --- /dev/null +++ b/src/services/documents-db.ts @@ -0,0 +1,2608 @@ +import { Service } from '../service'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; +import type { Models } from '../models'; + +import { UsageRange } from '../enums/usage-range'; +import { DocumentsDBIndexType } from '../enums/documents-db-index-type'; +import { OrderBy } from '../enums/order-by'; + +export class DocumentsDB { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + /** + * 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; + /** + * 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; + list( + paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[], + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { queries?: string[], search?: string, total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + search: rest[0] as string, + total: rest[1] as boolean + }; + } + + const queries = params.queries; + const search = params.search; + const total = params.total; + + + const apiPath = '/documentsdb'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof search !== 'undefined') { + payload['search'] = search; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * Create a new Database. + * + * + * @param {string} params.databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Database name. Max length: 128 chars. + * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @throws {AppwriteException} + * @returns {Promise} + */ + create(params: { databaseId: string, name: string, enabled?: boolean }): Promise; + /** + * Create a new Database. + * + * + * @param {string} databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Database name. Max length: 128 chars. + * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + create(databaseId: string, name: string, enabled?: boolean): Promise; + create( + paramsOrFirst: { databaseId: string, name: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { databaseId: string, name: string, enabled?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean }; + } else { + params = { + databaseId: paramsOrFirst as string, + name: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const databaseId = params.databaseId; + const name = params.name; + const enabled = params.enabled; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/documentsdb'; + const payload: Payload = {}; + if (typeof databaseId !== 'undefined') { + payload['databaseId'] = databaseId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @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). + * @throws {AppwriteException} + * @returns {Promise} + */ + listTransactions(params?: { queries?: string[] }): Promise; + /** + * + * @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). + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listTransactions(queries?: string[]): Promise; + listTransactions( + paramsOrFirst?: { queries?: string[] } | string[] + ): Promise { + let params: { queries?: string[] }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[] }; + } else { + params = { + queries: paramsOrFirst as string[] + }; + } + + const queries = params.queries; + + + const apiPath = '/documentsdb/transactions'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {number} params.ttl - Seconds before the transaction expires. + * @throws {AppwriteException} + * @returns {Promise} + */ + createTransaction(params?: { ttl?: number }): Promise; + /** + * + * @param {number} ttl - Seconds before the transaction expires. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createTransaction(ttl?: number): Promise; + createTransaction( + paramsOrFirst?: { ttl?: number } | number + ): Promise { + let params: { ttl?: number }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { ttl?: number }; + } else { + params = { + ttl: paramsOrFirst as number + }; + } + + const ttl = params.ttl; + + + const apiPath = '/documentsdb/transactions'; + const payload: Payload = {}; + if (typeof ttl !== 'undefined') { + payload['ttl'] = ttl; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.transactionId - Transaction ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getTransaction(params: { transactionId: string }): Promise; + /** + * + * @param {string} transactionId - Transaction ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getTransaction(transactionId: string): Promise; + getTransaction( + paramsOrFirst: { transactionId: string } | string + ): Promise { + let params: { transactionId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { transactionId: string }; + } else { + params = { + transactionId: paramsOrFirst as string + }; + } + + const transactionId = params.transactionId; + + if (typeof transactionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "transactionId"'); + } + + const apiPath = '/documentsdb/transactions/{transactionId}'.replace('{transactionId}', transactionId); + 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 + ); + } + + /** + * + * @param {string} params.transactionId - Transaction ID. + * @param {boolean} params.commit - Commit transaction? + * @param {boolean} params.rollback - Rollback transaction? + * @throws {AppwriteException} + * @returns {Promise} + */ + updateTransaction(params: { transactionId: string, commit?: boolean, rollback?: boolean }): Promise; + /** + * + * @param {string} transactionId - Transaction ID. + * @param {boolean} commit - Commit transaction? + * @param {boolean} rollback - Rollback transaction? + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateTransaction(transactionId: string, commit?: boolean, rollback?: boolean): Promise; + updateTransaction( + paramsOrFirst: { transactionId: string, commit?: boolean, rollback?: boolean } | string, + ...rest: [(boolean)?, (boolean)?] + ): Promise { + let params: { transactionId: string, commit?: boolean, rollback?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { transactionId: string, commit?: boolean, rollback?: boolean }; + } else { + params = { + transactionId: paramsOrFirst as string, + commit: rest[0] as boolean, + rollback: rest[1] as boolean + }; + } + + const transactionId = params.transactionId; + const commit = params.commit; + const rollback = params.rollback; + + if (typeof transactionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "transactionId"'); + } + + const apiPath = '/documentsdb/transactions/{transactionId}'.replace('{transactionId}', transactionId); + const payload: Payload = {}; + if (typeof commit !== 'undefined') { + payload['commit'] = commit; + } + if (typeof rollback !== 'undefined') { + payload['rollback'] = rollback; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.transactionId - Transaction ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteTransaction(params: { transactionId: string }): Promise<{}>; + /** + * + * @param {string} transactionId - Transaction ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteTransaction(transactionId: string): Promise<{}>; + deleteTransaction( + paramsOrFirst: { transactionId: string } | string + ): Promise<{}> { + let params: { transactionId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { transactionId: string }; + } else { + params = { + transactionId: paramsOrFirst as string + }; + } + + const transactionId = params.transactionId; + + if (typeof transactionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "transactionId"'); + } + + const apiPath = '/documentsdb/transactions/{transactionId}'.replace('{transactionId}', transactionId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } + + /** + * List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. + * + * @param {UsageRange} params.range - Date range. + * @throws {AppwriteException} + * @returns {Promise} + */ + listUsage(params?: { range?: UsageRange }): Promise; + /** + * List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. + * + * @param {UsageRange} range - Date range. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listUsage(range?: UsageRange): Promise; + listUsage( + paramsOrFirst?: { range?: UsageRange } | UsageRange + ): Promise { + let params: { range?: UsageRange }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) { + params = (paramsOrFirst || {}) as { range?: UsageRange }; + } else { + params = { + range: paramsOrFirst as UsageRange + }; + } + + const range = params.range; + + + const apiPath = '/documentsdb/usage'; + const payload: Payload = {}; + if (typeof range !== 'undefined') { + payload['range'] = range; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. + * + * @param {string} params.databaseId - Database ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + get(params: { databaseId: string }): Promise; + /** + * Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. + * + * @param {string} databaseId - Database ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + get(databaseId: string): Promise; + get( + paramsOrFirst: { databaseId: string } | string + ): Promise { + let params: { databaseId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string }; + } else { + params = { + databaseId: paramsOrFirst as string + }; + } + + const databaseId = params.databaseId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + const apiPath = '/documentsdb/{databaseId}'.replace('{databaseId}', databaseId); + 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 + ); + } + + /** + * Update a database by its unique ID. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.name - Database name. Max length: 128 chars. + * @param {boolean} params.enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @throws {AppwriteException} + * @returns {Promise} + */ + update(params: { databaseId: string, name: string, enabled?: boolean }): Promise; + /** + * Update a database by its unique ID. + * + * @param {string} databaseId - Database ID. + * @param {string} name - Database name. Max length: 128 chars. + * @param {boolean} enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + update(databaseId: string, name: string, enabled?: boolean): Promise; + update( + paramsOrFirst: { databaseId: string, name: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { databaseId: string, name: string, enabled?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean }; + } else { + params = { + databaseId: paramsOrFirst as string, + name: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const databaseId = params.databaseId; + const name = params.name; + const enabled = params.enabled; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/documentsdb/{databaseId}'.replace('{databaseId}', databaseId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } + + /** + * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. + * + * @param {string} params.databaseId - Database ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + delete(params: { databaseId: string }): Promise<{}>; + /** + * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. + * + * @param {string} databaseId - Database ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + delete(databaseId: string): Promise<{}>; + delete( + paramsOrFirst: { databaseId: string } | string + ): Promise<{}> { + let params: { databaseId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string }; + } else { + params = { + databaseId: paramsOrFirst as string + }; + } + + const databaseId = params.databaseId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + const apiPath = '/documentsdb/{databaseId}'.replace('{databaseId}', databaseId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } + + /** + * Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. + * + * @param {string} params.databaseId - Database ID. + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity + * @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} + */ + listCollections(params: { databaseId: string, queries?: string[], search?: string, total?: boolean }): Promise; + /** + * Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. + * + * @param {string} databaseId - Database ID. + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity + * @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. + */ + listCollections(databaseId: string, queries?: string[], search?: string, total?: boolean): Promise; + listCollections( + paramsOrFirst: { databaseId: string, queries?: string[], search?: string, total?: boolean } | string, + ...rest: [(string[])?, (string)?, (boolean)?] + ): Promise { + let params: { databaseId: string, queries?: string[], search?: string, total?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, queries?: string[], search?: string, total?: boolean }; + } else { + params = { + databaseId: paramsOrFirst as string, + queries: rest[0] as string[], + search: rest[1] as string, + total: rest[2] as boolean + }; + } + + const databaseId = params.databaseId; + const queries = params.queries; + const search = params.search; + const total = params.total; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections'.replace('{databaseId}', databaseId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof search !== 'undefined') { + payload['search'] = search; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Collection name. Max length: 128 chars. + * @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @param {object[]} params.attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. + * @param {object[]} params.indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). + * @throws {AppwriteException} + * @returns {Promise} + */ + createCollection(params: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[] }): Promise; + /** + * Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Collection name. Max length: 128 chars. + * @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @param {object[]} attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. + * @param {object[]} indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[]): Promise; + createCollection( + paramsOrFirst: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[] } | string, + ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (object[])?, (object[])?] + ): Promise { + let params: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[] }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + name: rest[1] as string, + permissions: rest[2] as string[], + documentSecurity: rest[3] as boolean, + enabled: rest[4] as boolean, + attributes: rest[5] as object[], + indexes: rest[6] as object[] + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const name = params.name; + const permissions = params.permissions; + const documentSecurity = params.documentSecurity; + const enabled = params.enabled; + const attributes = params.attributes; + const indexes = params.indexes; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections'.replace('{databaseId}', databaseId); + const payload: Payload = {}; + if (typeof collectionId !== 'undefined') { + payload['collectionId'] = collectionId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + if (typeof documentSecurity !== 'undefined') { + payload['documentSecurity'] = documentSecurity; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + if (typeof attributes !== 'undefined') { + payload['attributes'] = attributes; + } + if (typeof indexes !== 'undefined') { + payload['indexes'] = indexes; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } + + /** + * Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getCollection(params: { databaseId: string, collectionId: string }): Promise; + /** + * Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getCollection(databaseId: string, collectionId: string): Promise; + getCollection( + paramsOrFirst: { databaseId: string, collectionId: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { databaseId: string, collectionId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + 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 + ); + } + + /** + * Update a collection by its unique ID. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.name - Collection name. Max length: 128 chars. + * @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateCollection(params: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }): Promise; + /** + * Update a collection by its unique ID. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} name - Collection name. Max length: 128 chars. + * @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise; + updateCollection( + paramsOrFirst: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?] + ): Promise { + let params: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + name: rest[1] as string, + permissions: rest[2] as string[], + documentSecurity: rest[3] as boolean, + enabled: rest[4] as boolean + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const name = params.name; + const permissions = params.permissions; + const documentSecurity = params.documentSecurity; + const enabled = params.enabled; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + if (typeof documentSecurity !== 'undefined') { + payload['documentSecurity'] = documentSecurity; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } + + /** + * Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteCollection(params: { databaseId: string, collectionId: string }): Promise<{}>; + /** + * Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteCollection(databaseId: string, collectionId: string): Promise<{}>; + deleteCollection( + paramsOrFirst: { databaseId: string, collectionId: string } | string, + ...rest: [(string)?] + ): Promise<{}> { + let params: { databaseId: string, collectionId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } + + /** + * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @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. + * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise>} + */ + listDocuments(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }): Promise>; + /** + * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @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. + * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listDocuments(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number): Promise>; + listDocuments( + paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number } | string, + ...rest: [(string)?, (string[])?, (string)?, (boolean)?, (number)?] + ): Promise> { + let params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + queries: rest[1] as string[], + transactionId: rest[2] as string, + total: rest[3] as boolean, + ttl: rest[4] as number + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const queries = params.queries; + const transactionId = params.transactionId; + const total = params.total; + const ttl = params.ttl; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + if (typeof ttl !== 'undefined') { + payload['ttl'] = ttl; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param {string} params.documentId - Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit} params.data - Document data as JSON object. + * @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @throws {AppwriteException} + * @returns {Promise} + */ + createDocument(params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[] }): Promise; + /** + * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param {string} documentId - Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit} data - Document data as JSON object. + * @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createDocument(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[]): Promise; + createDocument( + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[] } | string, + ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit)?, (string[])?] + ): Promise { + let params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[] }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + data: rest[2] as Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, + permissions: rest[3] as string[] + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const data = params.data; + const permissions = params.permissions; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + if (typeof data === 'undefined') { + throw new AppwriteException('Missing required parameter: "data"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof documentId !== 'undefined') { + payload['documentId'] = documentId; + } + if (typeof data !== 'undefined') { + payload['data'] = data; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } + + /** + * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param {object[]} params.documents - Array of documents data as JSON objects. + * @throws {AppwriteException} + * @returns {Promise>} + */ + createDocuments(params: { databaseId: string, collectionId: string, documents: object[] }): Promise>; + /** + * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param {object[]} documents - Array of documents data as JSON objects. + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createDocuments(databaseId: string, collectionId: string, documents: object[]): Promise>; + createDocuments( + paramsOrFirst: { databaseId: string, collectionId: string, documents: object[] } | string, + ...rest: [(string)?, (object[])?] + ): Promise> { + let params: { databaseId: string, collectionId: string, documents: object[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documents: object[] }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documents: rest[1] as object[] + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documents = params.documents; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documents === 'undefined') { + throw new AppwriteException('Missing required parameter: "documents"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof documents !== 'undefined') { + payload['documents'] = documents; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } + + /** + * Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {object[]} params.documents - Array of document data as JSON objects. May contain partial documents. + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise>} + */ + upsertDocuments(params: { databaseId: string, collectionId: string, documents: object[], transactionId?: string }): Promise>; + /** + * Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {object[]} documents - Array of document data as JSON objects. May contain partial documents. + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + upsertDocuments(databaseId: string, collectionId: string, documents: object[], transactionId?: string): Promise>; + upsertDocuments( + paramsOrFirst: { databaseId: string, collectionId: string, documents: object[], transactionId?: string } | string, + ...rest: [(string)?, (object[])?, (string)?] + ): Promise> { + let params: { databaseId: string, collectionId: string, documents: object[], transactionId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documents: object[], transactionId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documents: rest[1] as object[], + transactionId: rest[2] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documents = params.documents; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documents === 'undefined') { + throw new AppwriteException('Missing required parameter: "documents"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof documents !== 'undefined') { + payload['documents'] = documents; + } + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } + + /** + * Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {object} params.data - Document data as JSON object. Include only attribute and value pairs to be updated. + * @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. + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise>} + */ + updateDocuments(params: { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string }): Promise>; + /** + * Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {object} data - Document data as JSON object. Include only attribute and value pairs to be updated. + * @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. + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateDocuments(databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string): Promise>; + updateDocuments( + paramsOrFirst: { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string } | string, + ...rest: [(string)?, (object)?, (string[])?, (string)?] + ): Promise> { + let params: { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + data: rest[1] as object, + queries: rest[2] as string[], + transactionId: rest[3] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const data = params.data; + const queries = params.queries; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof data !== 'undefined') { + payload['data'] = data; + } + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } + + /** + * Bulk delete documents using queries, if no queries are passed then all documents are deleted. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @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. + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise>} + */ + deleteDocuments(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string }): Promise>; + /** + * Bulk delete documents using queries, if no queries are passed then all documents are deleted. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @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. + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteDocuments(databaseId: string, collectionId: string, queries?: string[], transactionId?: string): Promise>; + deleteDocuments( + paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string } | string, + ...rest: [(string)?, (string[])?, (string)?] + ): Promise> { + let params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], transactionId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + queries: rest[1] as string[], + transactionId: rest[2] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const queries = params.queries; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } + + /** + * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} params.documentId - Document ID. + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. + * @throws {AppwriteException} + * @returns {Promise} + */ + getDocument(params: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }): Promise; + /** + * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} documentId - Document ID. + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getDocument(databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string): Promise; + getDocument( + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string } | string, + ...rest: [(string)?, (string)?, (string[])?, (string)?] + ): Promise { + let params: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + queries: rest[2] as string[], + transactionId: rest[3] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const queries = params.queries; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.documentId - Document ID. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} params.data - Document data as JSON object. Include all required fields of the document to be created or updated. + * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + upsertDocument(params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }): Promise; + /** + * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} documentId - Document ID. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} data - Document data as JSON object. Include all required fields of the document to be created or updated. + * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + upsertDocument(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string): Promise; + upsertDocument( + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string } | string, + ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>)?, (string[])?, (string)?] + ): Promise { + let params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + data: rest[2] as Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, + permissions: rest[3] as string[], + transactionId: rest[4] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const data = params.data; + const permissions = params.permissions; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); + const payload: Payload = {}; + if (typeof data !== 'undefined') { + payload['data'] = data; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } + + /** + * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.documentId - Document ID. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} params.data - Document data as JSON object. Include only fields and value pairs to be updated. + * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateDocument(params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }): Promise; + /** + * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} documentId - Document ID. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} data - Document data as JSON object. Include only fields and value pairs to be updated. + * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateDocument(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string): Promise; + updateDocument( + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string } | string, + ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>)?, (string[])?, (string)?] + ): Promise { + let params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + data: rest[2] as Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, + permissions: rest[3] as string[], + transactionId: rest[4] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const data = params.data; + const permissions = params.permissions; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); + const payload: Payload = {}; + if (typeof data !== 'undefined') { + payload['data'] = data; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } + + /** + * Delete a document by its unique ID. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} params.documentId - Document ID. + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteDocument(params: { databaseId: string, collectionId: string, documentId: string, transactionId?: string }): Promise<{}>; + /** + * Delete a document by its unique ID. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} documentId - Document ID. + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteDocument(databaseId: string, collectionId: string, documentId: string, transactionId?: string): Promise<{}>; + deleteDocument( + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, transactionId?: string } | string, + ...rest: [(string)?, (string)?, (string)?] + ): Promise<{}> { + let params: { databaseId: string, collectionId: string, documentId: string, transactionId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, transactionId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + transactionId: rest[2] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); + const payload: Payload = {}; + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } + + /** + * Get the document activity logs list by its unique ID. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.documentId - Document ID. + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @throws {AppwriteException} + * @returns {Promise} + */ + listDocumentLogs(params: { databaseId: string, collectionId: string, documentId: string, queries?: string[] }): Promise; + /** + * Get the document activity logs list by its unique ID. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} documentId - Document ID. + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listDocumentLogs(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise; + listDocumentLogs( + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, queries?: string[] } | string, + ...rest: [(string)?, (string)?, (string[])?] + ): Promise { + let params: { databaseId: string, collectionId: string, documentId: string, queries?: string[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, queries?: string[] }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + queries: rest[2] as string[] + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const queries = params.queries; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * Decrement a specific column of a row by a given value. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.documentId - Document ID. + * @param {string} params.attribute - Attribute key. + * @param {number} params.value - Value to decrement the attribute by. The value must be a number. + * @param {number} params.min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + decrementDocumentAttribute(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }): Promise; + /** + * Decrement a specific column of a row by a given value. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} documentId - Document ID. + * @param {string} attribute - Attribute key. + * @param {number} value - Value to decrement the attribute by. The value must be a number. + * @param {number} min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + decrementDocumentAttribute(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string): Promise; + decrementDocumentAttribute( + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?] + ): Promise { + let params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + attribute: rest[2] as string, + value: rest[3] as number, + min: rest[4] as number, + transactionId: rest[5] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const attribute = params.attribute; + const value = params.value; + const min = params.min; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + if (typeof attribute === 'undefined') { + throw new AppwriteException('Missing required parameter: "attribute"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute); + const payload: Payload = {}; + if (typeof value !== 'undefined') { + payload['value'] = value; + } + if (typeof min !== 'undefined') { + payload['min'] = min; + } + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } + + /** + * Increment a specific column of a row by a given value. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.documentId - Document ID. + * @param {string} params.attribute - Attribute key. + * @param {number} params.value - Value to increment the attribute by. The value must be a number. + * @param {number} params.max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + incrementDocumentAttribute(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }): Promise; + /** + * Increment a specific column of a row by a given value. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} documentId - Document ID. + * @param {string} attribute - Attribute key. + * @param {number} value - Value to increment the attribute by. The value must be a number. + * @param {number} max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + incrementDocumentAttribute(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string): Promise; + incrementDocumentAttribute( + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?] + ): Promise { + let params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + attribute: rest[2] as string, + value: rest[3] as number, + max: rest[4] as number, + transactionId: rest[5] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const attribute = params.attribute; + const value = params.value; + const max = params.max; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + if (typeof attribute === 'undefined') { + throw new AppwriteException('Missing required parameter: "attribute"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute); + const payload: Payload = {}; + if (typeof value !== 'undefined') { + payload['value'] = value; + } + if (typeof max !== 'undefined') { + payload['max'] = max; + } + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } + + /** + * List indexes in the collection. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listIndexes(params: { databaseId: string, collectionId: string, queries?: string[], total?: boolean }): Promise; + /** + * List indexes in the collection. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error + * @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. + */ + listIndexes(databaseId: string, collectionId: string, queries?: string[], total?: boolean): Promise; + listIndexes( + paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], total?: boolean } | string, + ...rest: [(string)?, (string[])?, (boolean)?] + ): Promise { + let params: { databaseId: string, collectionId: string, queries?: string[], total?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], total?: boolean }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + queries: rest[1] as string[], + total: rest[2] as boolean + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const queries = params.queries; + const total = params.total; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. + * Attributes can be `key`, `fulltext`, and `unique`. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} params.key - Index Key. + * @param {DocumentsDBIndexType} params.type - Index type. + * @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. + * @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed. + * @param {number[]} params.lengths - Length of index. Maximum of 100 + * @throws {AppwriteException} + * @returns {Promise} + */ + createIndex(params: { databaseId: string, collectionId: string, key: string, type: DocumentsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }): Promise; + /** + * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. + * Attributes can be `key`, `fulltext`, and `unique`. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} key - Index Key. + * @param {DocumentsDBIndexType} type - Index type. + * @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. + * @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed. + * @param {number[]} lengths - Length of index. Maximum of 100 + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createIndex(databaseId: string, collectionId: string, key: string, type: DocumentsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[]): Promise; + createIndex( + paramsOrFirst: { databaseId: string, collectionId: string, key: string, type: DocumentsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] } | string, + ...rest: [(string)?, (string)?, (DocumentsDBIndexType)?, (string[])?, (OrderBy[])?, (number[])?] + ): Promise { + let params: { databaseId: string, collectionId: string, key: string, type: DocumentsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, type: DocumentsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + key: rest[1] as string, + type: rest[2] as DocumentsDBIndexType, + attributes: rest[3] as string[], + orders: rest[4] as OrderBy[], + lengths: rest[5] as number[] + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const key = params.key; + const type = params.type; + const attributes = params.attributes; + const orders = params.orders; + const lengths = params.lengths; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + if (typeof type === 'undefined') { + throw new AppwriteException('Missing required parameter: "type"'); + } + if (typeof attributes === 'undefined') { + throw new AppwriteException('Missing required parameter: "attributes"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof type !== 'undefined') { + payload['type'] = type; + } + if (typeof attributes !== 'undefined') { + payload['attributes'] = attributes; + } + if (typeof orders !== 'undefined') { + payload['orders'] = orders; + } + if (typeof lengths !== 'undefined') { + payload['lengths'] = lengths; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } + + /** + * Get index by ID. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} params.key - Index Key. + * @throws {AppwriteException} + * @returns {Promise} + */ + getIndex(params: { databaseId: string, collectionId: string, key: string }): Promise; + /** + * Get index by ID. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} key - Index Key. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getIndex(databaseId: string, collectionId: string, key: string): Promise; + getIndex( + paramsOrFirst: { databaseId: string, collectionId: string, key: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { databaseId: string, collectionId: string, key: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + key: rest[1] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const key = params.key; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + 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 + ); + } + + /** + * Delete an index. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} params.key - Index Key. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteIndex(params: { databaseId: string, collectionId: string, key: string }): Promise<{}>; + /** + * Delete an index. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} key - Index Key. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteIndex(databaseId: string, collectionId: string, key: string): Promise<{}>; + deleteIndex( + paramsOrFirst: { databaseId: string, collectionId: string, key: string } | string, + ...rest: [(string)?, (string)?] + ): Promise<{}> { + let params: { databaseId: string, collectionId: string, key: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + key: rest[1] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const key = params.key; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } + + /** + * Get the collection activity logs list by its unique ID. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @throws {AppwriteException} + * @returns {Promise} + */ + listCollectionLogs(params: { databaseId: string, collectionId: string, queries?: string[] }): Promise; + /** + * Get the collection activity logs list by its unique ID. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listCollectionLogs(databaseId: string, collectionId: string, queries?: string[]): Promise; + listCollectionLogs( + paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[] } | string, + ...rest: [(string)?, (string[])?] + ): Promise { + let params: { databaseId: string, collectionId: string, queries?: string[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[] }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + queries: rest[1] as string[] + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const queries = params.queries; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {UsageRange} params.range - Date range. + * @throws {AppwriteException} + * @returns {Promise} + */ + getCollectionUsage(params: { databaseId: string, collectionId: string, range?: UsageRange }): Promise; + /** + * Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {UsageRange} range - Date range. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getCollectionUsage(databaseId: string, collectionId: string, range?: UsageRange): Promise; + getCollectionUsage( + paramsOrFirst: { databaseId: string, collectionId: string, range?: UsageRange } | string, + ...rest: [(string)?, (UsageRange)?] + ): Promise { + let params: { databaseId: string, collectionId: string, range?: UsageRange }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, range?: UsageRange }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + range: rest[1] as UsageRange + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const range = params.range; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + + const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/usage'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof range !== 'undefined') { + payload['range'] = range; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. + * + * @param {string} params.databaseId - Database ID. + * @param {UsageRange} params.range - Date range. + * @throws {AppwriteException} + * @returns {Promise} + */ + getUsage(params: { databaseId: string, range?: UsageRange }): Promise; + /** + * Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. + * + * @param {string} databaseId - Database ID. + * @param {UsageRange} range - Date range. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getUsage(databaseId: string, range?: UsageRange): Promise; + getUsage( + paramsOrFirst: { databaseId: string, range?: UsageRange } | string, + ...rest: [(UsageRange)?] + ): Promise { + let params: { databaseId: string, range?: UsageRange }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, range?: UsageRange }; + } else { + params = { + databaseId: paramsOrFirst as string, + range: rest[0] as UsageRange + }; + } + + const databaseId = params.databaseId; + const range = params.range; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + const apiPath = '/documentsdb/{databaseId}/usage'.replace('{databaseId}', databaseId); + const payload: Payload = {}; + if (typeof range !== 'undefined') { + payload['range'] = range; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } +} diff --git a/src/services/domains.ts b/src/services/domains.ts index 087d486f..4d259420 100644 --- a/src/services/domains.ts +++ b/src/services/domains.ts @@ -207,7 +207,7 @@ export class Domains { } /** - * Create a domain purchase with registrant information. + * Initiate a domain purchase by providing registrant details and a payment method. Authorizes the payment and returns a `clientSecret`. If 3D Secure is required, use the `clientSecret` on the client to complete the authentication challenge. Once authentication is complete (or if none is needed), call the Update Purchase endpoint to capture the payment and finalize the purchase. * * @param {string} params.domain - Fully qualified domain name to purchase (for example, example.com). * @param {string} params.organizationId - Team ID that will own the domain. @@ -225,7 +225,7 @@ export class Domains { */ createPurchase(params: { domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number }): Promise; /** - * Create a domain purchase with registrant information. + * Initiate a domain purchase by providing registrant details and a payment method. Authorizes the payment and returns a `clientSecret`. If 3D Secure is required, use the `clientSecret` on the client to complete the authentication challenge. Once authentication is complete (or if none is needed), call the Update Purchase endpoint to capture the payment and finalize the purchase. * * @param {string} domain - Fully qualified domain name to purchase (for example, example.com). * @param {string} organizationId - Team ID that will own the domain. @@ -354,7 +354,7 @@ export class Domains { } /** - * Confirm and complete a domain purchase after payment authentication. + * Finalize a domain purchase initiated with Create Purchase. Verifies that any required 3D Secure authentication is complete, registers the domain, captures the payment, and provisions default DNS records. Returns a 402 error if authentication is still pending. * * @param {string} params.domainId - Domain ID to confirm purchase for. * @param {string} params.organizationId - Team ID that owns the domain. @@ -363,7 +363,7 @@ export class Domains { */ updatePurchase(params: { domainId: string, organizationId: string }): Promise; /** - * Confirm and complete a domain purchase after payment authentication. + * Finalize a domain purchase initiated with Create Purchase. Verifies that any required 3D Secure authentication is complete, registers the domain, captures the payment, and provisions default DNS records. Returns a 402 error if authentication is still pending. * * @param {string} domainId - Domain ID to confirm purchase for. * @param {string} organizationId - Team ID that owns the domain. @@ -507,7 +507,7 @@ export class Domains { } /** - * Create a domain transfer in with authorization code and registrant information. + * Initiate a domain transfer-in by providing an authorization code, registrant details, and a payment method. Authorizes the payment and returns a `clientSecret`. If 3D Secure is required, use the `clientSecret` on the client to complete the authentication challenge. Once authentication is complete (or if none is needed), call the Update Transfer In endpoint to capture the payment and submit the transfer. * * @param {string} params.domain - Domain name to transfer in. * @param {string} params.organizationId - Organization ID that this domain will belong to. @@ -518,7 +518,7 @@ export class Domains { */ createTransferIn(params: { domain: string, organizationId: string, authCode: string, paymentMethodId: string }): Promise; /** - * Create a domain transfer in with authorization code and registrant information. + * Initiate a domain transfer-in by providing an authorization code, registrant details, and a payment method. Authorizes the payment and returns a `clientSecret`. If 3D Secure is required, use the `clientSecret` on the client to complete the authentication challenge. Once authentication is complete (or if none is needed), call the Update Transfer In endpoint to capture the payment and submit the transfer. * * @param {string} domain - Domain name to transfer in. * @param {string} organizationId - Organization ID that this domain will belong to. @@ -593,7 +593,7 @@ export class Domains { } /** - * Confirm and complete a domain transfer in after payment authentication. + * Finalize a domain transfer-in initiated with Create Transfer In. Verifies that any required 3D Secure authentication is complete, submits the transfer with the authorization code, captures the payment, and sends a confirmation email. Returns a 402 error if authentication is still pending. * * @param {string} params.domainId - Domain ID to confirm transfer for. * @param {string} params.organizationId - Team ID that owns the domain. @@ -602,7 +602,7 @@ export class Domains { */ updateTransferIn(params: { domainId: string, organizationId: string }): Promise; /** - * Confirm and complete a domain transfer in after payment authentication. + * Finalize a domain transfer-in initiated with Create Transfer In. Verifies that any required 3D Secure authentication is complete, submits the transfer with the authorization code, captures the payment, and sends a confirmation email. Returns a 402 error if authentication is still pending. * * @param {string} domainId - Domain ID to confirm transfer for. * @param {string} organizationId - Team ID that owns the domain. @@ -656,7 +656,7 @@ export class Domains { } /** - * Create a domain transfer out and return the authorization code. + * Initiate a domain transfer-out by generating an authorization code for the specified domain. The returned `authCode` should be provided to the gaining provider to complete the transfer. If the domain has auto-renewal enabled, it will be automatically disabled as part of this operation. * * @param {string} params.domainId - Domain unique ID. * @param {string} params.organizationId - Organization ID that this domain belongs to. @@ -665,7 +665,7 @@ export class Domains { */ createTransferOut(params: { domainId: string, organizationId: string }): Promise; /** - * Create a domain transfer out and return the authorization code. + * Initiate a domain transfer-out by generating an authorization code for the specified domain. The returned `authCode` should be provided to the gaining provider to complete the transfer. If the domain has auto-renewal enabled, it will be automatically disabled as part of this operation. * * @param {string} domainId - Domain unique ID. * @param {string} organizationId - Organization ID that this domain belongs to. @@ -3817,7 +3817,7 @@ export class Domains { } /** - * Get the transfer status for a domain. + * Retrieve the current transfer status for a domain. Returns the status, an optional reason, and a timestamp of the last status change. * * @param {string} params.domainId - Domain unique ID. * @throws {AppwriteException} @@ -3825,7 +3825,7 @@ export class Domains { */ getTransferStatus(params: { domainId: string }): Promise; /** - * Get the transfer status for a domain. + * Retrieve the current transfer status for a domain. Returns the status, an optional reason, and a timestamp of the last status change. * * @param {string} domainId - Domain unique ID. * @throws {AppwriteException} diff --git a/src/services/project.ts b/src/services/project.ts index cd4c5720..d9fe9435 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -84,15 +84,51 @@ export class Project { } /** - * Get a list of all project variables. These variables will be accessible in all Appwrite Functions at runtime. + * Get a list of all project environment variables. * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} */ - listVariables(): Promise { + listVariables(params?: { queries?: string[], total?: boolean }): Promise; + /** + * Get a list of all project environment variables. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret + * @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. + */ + listVariables(queries?: string[], total?: boolean): Promise; + listVariables( + paramsOrFirst?: { queries?: string[], total?: boolean } | string[], + ...rest: [(boolean)?] + ): Promise { + let params: { queries?: string[], total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + total: rest[0] as boolean + }; + } + + const queries = params.queries; + const total = params.total; + const apiPath = '/project/variables'; const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -107,18 +143,20 @@ export class Project { } /** - * Create a new project variable. This variable will be accessible in all Appwrite Functions at runtime. + * Create a new project environment variable. These variables can be accessed by all functions and sites in the project. * + * @param {string} params.variableId - Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} params.key - Variable key. Max length: 255 chars. * @param {string} params.value - Variable value. Max length: 8192 chars. * @param {boolean} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime. * @throws {AppwriteException} * @returns {Promise} */ - createVariable(params: { key: string, value: string, secret?: boolean }): Promise; + createVariable(params: { variableId: string, key: string, value: string, secret?: boolean }): Promise; /** - * Create a new project variable. This variable will be accessible in all Appwrite Functions at runtime. + * Create a new project environment variable. These variables can be accessed by all functions and sites in the project. * + * @param {string} variableId - Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} key - Variable key. Max length: 255 chars. * @param {string} value - Variable value. Max length: 8192 chars. * @param {boolean} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime. @@ -126,27 +164,32 @@ export class Project { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createVariable(key: string, value: string, secret?: boolean): Promise; + createVariable(variableId: string, key: string, value: string, secret?: boolean): Promise; createVariable( - paramsOrFirst: { key: string, value: string, secret?: boolean } | string, - ...rest: [(string)?, (boolean)?] + paramsOrFirst: { variableId: string, key: string, value: string, secret?: boolean } | string, + ...rest: [(string)?, (string)?, (boolean)?] ): Promise { - let params: { key: string, value: string, secret?: boolean }; + let params: { variableId: string, key: string, value: string, secret?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { key: string, value: string, secret?: boolean }; + params = (paramsOrFirst || {}) as { variableId: string, key: string, value: string, secret?: boolean }; } else { params = { - key: paramsOrFirst as string, - value: rest[0] as string, - secret: rest[1] as boolean + variableId: paramsOrFirst as string, + key: rest[0] as string, + value: rest[1] as string, + secret: rest[2] as boolean }; } + const variableId = params.variableId; const key = params.key; const value = params.value; const secret = params.secret; + if (typeof variableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "variableId"'); + } if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } @@ -156,6 +199,9 @@ export class Project { const apiPath = '/project/variables'; const payload: Payload = {}; + if (typeof variableId !== 'undefined') { + payload['variableId'] = variableId; + } if (typeof key !== 'undefined') { payload['key'] = key; } @@ -180,17 +226,17 @@ export class Project { } /** - * Get a project variable by its unique ID. + * Get a variable by its unique ID. * - * @param {string} params.variableId - Variable unique ID. + * @param {string} params.variableId - Variable ID. * @throws {AppwriteException} * @returns {Promise} */ getVariable(params: { variableId: string }): Promise; /** - * Get a project variable by its unique ID. + * Get a variable by its unique ID. * - * @param {string} variableId - Variable unique ID. + * @param {string} variableId - Variable ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -231,20 +277,20 @@ export class Project { } /** - * Update project variable by its unique ID. This variable will be accessible in all Appwrite Functions at runtime. + * Update variable by its unique ID. * - * @param {string} params.variableId - Variable unique ID. + * @param {string} params.variableId - Variable ID. * @param {string} params.key - Variable key. Max length: 255 chars. * @param {string} params.value - Variable value. Max length: 8192 chars. * @param {boolean} params.secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime. * @throws {AppwriteException} * @returns {Promise} */ - updateVariable(params: { variableId: string, key: string, value?: string, secret?: boolean }): Promise; + updateVariable(params: { variableId: string, key?: string, value?: string, secret?: boolean }): Promise; /** - * Update project variable by its unique ID. This variable will be accessible in all Appwrite Functions at runtime. + * Update variable by its unique ID. * - * @param {string} variableId - Variable unique ID. + * @param {string} variableId - Variable ID. * @param {string} key - Variable key. Max length: 255 chars. * @param {string} value - Variable value. Max length: 8192 chars. * @param {boolean} secret - Secret variables can be updated or deleted, but only projects can read them during build and runtime. @@ -252,15 +298,15 @@ export class Project { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateVariable(variableId: string, key: string, value?: string, secret?: boolean): Promise; + updateVariable(variableId: string, key?: string, value?: string, secret?: boolean): Promise; updateVariable( - paramsOrFirst: { variableId: string, key: string, value?: string, secret?: boolean } | string, + paramsOrFirst: { variableId: string, key?: string, value?: string, secret?: boolean } | string, ...rest: [(string)?, (string)?, (boolean)?] ): Promise { - let params: { variableId: string, key: string, value?: string, secret?: boolean }; + let params: { variableId: string, key?: string, value?: string, secret?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { variableId: string, key: string, value?: string, secret?: boolean }; + params = (paramsOrFirst || {}) as { variableId: string, key?: string, value?: string, secret?: boolean }; } else { params = { variableId: paramsOrFirst as string, @@ -278,9 +324,6 @@ export class Project { if (typeof variableId === 'undefined') { throw new AppwriteException('Missing required parameter: "variableId"'); } - if (typeof key === 'undefined') { - throw new AppwriteException('Missing required parameter: "key"'); - } const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId); const payload: Payload = {}; @@ -308,17 +351,17 @@ export class Project { } /** - * Delete a project variable by its unique ID. + * Delete a variable by its unique ID. * - * @param {string} params.variableId - Variable unique ID. + * @param {string} params.variableId - Variable ID. * @throws {AppwriteException} * @returns {Promise<{}>} */ deleteVariable(params: { variableId: string }): Promise<{}>; /** - * Delete a project variable by its unique ID. + * Delete a variable by its unique ID. * - * @param {string} variableId - Variable unique ID. + * @param {string} variableId - Variable ID. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index c37d8768..add71230 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -5,7 +5,7 @@ import type { Models } from '../models'; import { UsageRange } from '../enums/usage-range'; import { RelationshipType } from '../enums/relationship-type'; import { RelationMutate } from '../enums/relation-mutate'; -import { IndexType } from '../enums/index-type'; +import { TablesDBIndexType } from '../enums/tables-db-index-type'; import { OrderBy } from '../enums/order-by'; export class TablesDB { @@ -4746,14 +4746,14 @@ export class TablesDB { * @param {string} params.databaseId - Database ID. * @param {string} params.tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Index Key. - * @param {IndexType} params.type - Index type. + * @param {TablesDBIndexType} params.type - Index type. * @param {string[]} params.columns - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long. * @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed. * @param {number[]} params.lengths - Length of index. Maximum of 100 * @throws {AppwriteException} * @returns {Promise} */ - createIndex(params: { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: OrderBy[], lengths?: number[] }): Promise; + createIndex(params: { databaseId: string, tableId: string, key: string, type: TablesDBIndexType, columns: string[], orders?: OrderBy[], lengths?: number[] }): Promise; /** * Creates an index on the columns listed. Your index should include all the columns you will query in a single request. * Type can be `key`, `fulltext`, or `unique`. @@ -4761,7 +4761,7 @@ export class TablesDB { * @param {string} databaseId - Database ID. * @param {string} tableId - Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Index Key. - * @param {IndexType} type - Index type. + * @param {TablesDBIndexType} type - Index type. * @param {string[]} columns - Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long. * @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed. * @param {number[]} lengths - Length of index. Maximum of 100 @@ -4769,21 +4769,21 @@ export class TablesDB { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createIndex(databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: OrderBy[], lengths?: number[]): Promise; + createIndex(databaseId: string, tableId: string, key: string, type: TablesDBIndexType, columns: string[], orders?: OrderBy[], lengths?: number[]): Promise; createIndex( - paramsOrFirst: { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: OrderBy[], lengths?: number[] } | string, - ...rest: [(string)?, (string)?, (IndexType)?, (string[])?, (OrderBy[])?, (number[])?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, type: TablesDBIndexType, columns: string[], orders?: OrderBy[], lengths?: number[] } | string, + ...rest: [(string)?, (string)?, (TablesDBIndexType)?, (string[])?, (OrderBy[])?, (number[])?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: OrderBy[], lengths?: number[] }; + let params: { databaseId: string, tableId: string, key: string, type: TablesDBIndexType, columns: string[], orders?: OrderBy[], lengths?: number[] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, type: IndexType, columns: string[], orders?: OrderBy[], lengths?: number[] }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, type: TablesDBIndexType, columns: string[], orders?: OrderBy[], lengths?: number[] }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, - type: rest[2] as IndexType, + type: rest[2] as TablesDBIndexType, columns: rest[3] as string[], orders: rest[4] as OrderBy[], lengths: rest[5] as number[] diff --git a/src/services/users.ts b/src/services/users.ts index 5451dc68..0d0555d2 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -17,7 +17,7 @@ export class Users { /** * Get a list of all the project's users. You can use the query params to filter your results. * - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator * @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} @@ -27,7 +27,7 @@ export class Users { /** * Get a list of all the project's users. You can use the query params to filter your results. * - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator * @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} @@ -1169,6 +1169,71 @@ export class Users { ); } + /** + * Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data. + * + * + * @param {string} params.userId - User ID. + * @param {boolean} params.impersonator - Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data. + * @throws {AppwriteException} + * @returns {Promise>} + */ + updateImpersonator(params: { userId: string, impersonator: boolean }): Promise>; + /** + * Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data. + * + * + * @param {string} userId - User ID. + * @param {boolean} impersonator - Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data. + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateImpersonator(userId: string, impersonator: boolean): Promise>; + updateImpersonator( + paramsOrFirst: { userId: string, impersonator: boolean } | string, + ...rest: [(boolean)?] + ): Promise> { + let params: { userId: string, impersonator: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { userId: string, impersonator: boolean }; + } else { + params = { + userId: paramsOrFirst as string, + impersonator: rest[0] as boolean + }; + } + + const userId = params.userId; + const impersonator = params.impersonator; + + if (typeof userId === 'undefined') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + if (typeof impersonator === 'undefined') { + throw new AppwriteException('Missing required parameter: "impersonator"'); + } + + const apiPath = '/users/{userId}/impersonator'.replace('{userId}', userId); + const payload: Payload = {}; + if (typeof impersonator !== 'undefined') { + payload['impersonator'] = impersonator; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } + /** * Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted. * diff --git a/src/services/vectors-db.ts b/src/services/vectors-db.ts new file mode 100644 index 00000000..fa422e08 --- /dev/null +++ b/src/services/vectors-db.ts @@ -0,0 +1,2477 @@ +import { Service } from '../service'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; +import type { Models } from '../models'; + +import { Model } from '../enums/model'; +import { UsageRange } from '../enums/usage-range'; +import { VectorsDBIndexType } from '../enums/vectors-db-index-type'; +import { OrderBy } from '../enums/order-by'; + +export class VectorsDB { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + /** + * + * @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; + /** + * + * @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; + list( + paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[], + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { queries?: string[], search?: string, total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + search: rest[0] as string, + total: rest[1] as boolean + }; + } + + const queries = params.queries; + const search = params.search; + const total = params.total; + + + const apiPath = '/vectorsdb'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof search !== 'undefined') { + payload['search'] = search; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Database name. Max length: 128 chars. + * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @throws {AppwriteException} + * @returns {Promise} + */ + create(params: { databaseId: string, name: string, enabled?: boolean }): Promise; + /** + * + * @param {string} databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Database name. Max length: 128 chars. + * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + create(databaseId: string, name: string, enabled?: boolean): Promise; + create( + paramsOrFirst: { databaseId: string, name: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { databaseId: string, name: string, enabled?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean }; + } else { + params = { + databaseId: paramsOrFirst as string, + name: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const databaseId = params.databaseId; + const name = params.name; + const enabled = params.enabled; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/vectorsdb'; + const payload: Payload = {}; + if (typeof databaseId !== 'undefined') { + payload['databaseId'] = databaseId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string[]} params.texts - Array of text to generate embeddings. + * @param {Model} params.model - The embedding model to use for generating vector embeddings. + * @throws {AppwriteException} + * @returns {Promise} + */ + createTextEmbeddings(params: { texts: string[], model?: Model }): Promise; + /** + * + * @param {string[]} texts - Array of text to generate embeddings. + * @param {Model} model - The embedding model to use for generating vector embeddings. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createTextEmbeddings(texts: string[], model?: Model): Promise; + createTextEmbeddings( + paramsOrFirst: { texts: string[], model?: Model } | string[], + ...rest: [(Model)?] + ): Promise { + let params: { texts: string[], model?: Model }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { texts: string[], model?: Model }; + } else { + params = { + texts: paramsOrFirst as string[], + model: rest[0] as Model + }; + } + + const texts = params.texts; + const model = params.model; + + if (typeof texts === 'undefined') { + throw new AppwriteException('Missing required parameter: "texts"'); + } + + const apiPath = '/vectorsdb/embeddings/text'; + const payload: Payload = {}; + if (typeof texts !== 'undefined') { + payload['texts'] = texts; + } + if (typeof model !== 'undefined') { + payload['model'] = model; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @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). + * @throws {AppwriteException} + * @returns {Promise} + */ + listTransactions(params?: { queries?: string[] }): Promise; + /** + * + * @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). + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listTransactions(queries?: string[]): Promise; + listTransactions( + paramsOrFirst?: { queries?: string[] } | string[] + ): Promise { + let params: { queries?: string[] }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[] }; + } else { + params = { + queries: paramsOrFirst as string[] + }; + } + + const queries = params.queries; + + + const apiPath = '/vectorsdb/transactions'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {number} params.ttl - Seconds before the transaction expires. + * @throws {AppwriteException} + * @returns {Promise} + */ + createTransaction(params?: { ttl?: number }): Promise; + /** + * + * @param {number} ttl - Seconds before the transaction expires. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createTransaction(ttl?: number): Promise; + createTransaction( + paramsOrFirst?: { ttl?: number } | number + ): Promise { + let params: { ttl?: number }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { ttl?: number }; + } else { + params = { + ttl: paramsOrFirst as number + }; + } + + const ttl = params.ttl; + + + const apiPath = '/vectorsdb/transactions'; + const payload: Payload = {}; + if (typeof ttl !== 'undefined') { + payload['ttl'] = ttl; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.transactionId - Transaction ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getTransaction(params: { transactionId: string }): Promise; + /** + * + * @param {string} transactionId - Transaction ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getTransaction(transactionId: string): Promise; + getTransaction( + paramsOrFirst: { transactionId: string } | string + ): Promise { + let params: { transactionId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { transactionId: string }; + } else { + params = { + transactionId: paramsOrFirst as string + }; + } + + const transactionId = params.transactionId; + + if (typeof transactionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "transactionId"'); + } + + const apiPath = '/vectorsdb/transactions/{transactionId}'.replace('{transactionId}', transactionId); + 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 + ); + } + + /** + * + * @param {string} params.transactionId - Transaction ID. + * @param {boolean} params.commit - Commit transaction? + * @param {boolean} params.rollback - Rollback transaction? + * @throws {AppwriteException} + * @returns {Promise} + */ + updateTransaction(params: { transactionId: string, commit?: boolean, rollback?: boolean }): Promise; + /** + * + * @param {string} transactionId - Transaction ID. + * @param {boolean} commit - Commit transaction? + * @param {boolean} rollback - Rollback transaction? + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateTransaction(transactionId: string, commit?: boolean, rollback?: boolean): Promise; + updateTransaction( + paramsOrFirst: { transactionId: string, commit?: boolean, rollback?: boolean } | string, + ...rest: [(boolean)?, (boolean)?] + ): Promise { + let params: { transactionId: string, commit?: boolean, rollback?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { transactionId: string, commit?: boolean, rollback?: boolean }; + } else { + params = { + transactionId: paramsOrFirst as string, + commit: rest[0] as boolean, + rollback: rest[1] as boolean + }; + } + + const transactionId = params.transactionId; + const commit = params.commit; + const rollback = params.rollback; + + if (typeof transactionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "transactionId"'); + } + + const apiPath = '/vectorsdb/transactions/{transactionId}'.replace('{transactionId}', transactionId); + const payload: Payload = {}; + if (typeof commit !== 'undefined') { + payload['commit'] = commit; + } + if (typeof rollback !== 'undefined') { + payload['rollback'] = rollback; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.transactionId - Transaction ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteTransaction(params: { transactionId: string }): Promise<{}>; + /** + * + * @param {string} transactionId - Transaction ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteTransaction(transactionId: string): Promise<{}>; + deleteTransaction( + paramsOrFirst: { transactionId: string } | string + ): Promise<{}> { + let params: { transactionId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { transactionId: string }; + } else { + params = { + transactionId: paramsOrFirst as string + }; + } + + const transactionId = params.transactionId; + + if (typeof transactionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "transactionId"'); + } + + const apiPath = '/vectorsdb/transactions/{transactionId}'.replace('{transactionId}', transactionId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.transactionId - Transaction ID. + * @param {object[]} params.operations - Array of staged operations. + * @throws {AppwriteException} + * @returns {Promise} + */ + createOperations(params: { transactionId: string, operations?: object[] }): Promise; + /** + * + * @param {string} transactionId - Transaction ID. + * @param {object[]} operations - Array of staged operations. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createOperations(transactionId: string, operations?: object[]): Promise; + createOperations( + paramsOrFirst: { transactionId: string, operations?: object[] } | string, + ...rest: [(object[])?] + ): Promise { + let params: { transactionId: string, operations?: object[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { transactionId: string, operations?: object[] }; + } else { + params = { + transactionId: paramsOrFirst as string, + operations: rest[0] as object[] + }; + } + + const transactionId = params.transactionId; + const operations = params.operations; + + if (typeof transactionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "transactionId"'); + } + + const apiPath = '/vectorsdb/transactions/{transactionId}/operations'.replace('{transactionId}', transactionId); + const payload: Payload = {}; + if (typeof operations !== 'undefined') { + payload['operations'] = operations; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {UsageRange} params.range - Date range. + * @throws {AppwriteException} + * @returns {Promise} + */ + listUsage(params?: { range?: UsageRange }): Promise; + /** + * + * @param {UsageRange} range - Date range. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listUsage(range?: UsageRange): Promise; + listUsage( + paramsOrFirst?: { range?: UsageRange } | UsageRange + ): Promise { + let params: { range?: UsageRange }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) { + params = (paramsOrFirst || {}) as { range?: UsageRange }; + } else { + params = { + range: paramsOrFirst as UsageRange + }; + } + + const range = params.range; + + + const apiPath = '/vectorsdb/usage'; + const payload: Payload = {}; + if (typeof range !== 'undefined') { + payload['range'] = range; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + get(params: { databaseId: string }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + get(databaseId: string): Promise; + get( + paramsOrFirst: { databaseId: string } | string + ): Promise { + let params: { databaseId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string }; + } else { + params = { + databaseId: paramsOrFirst as string + }; + } + + const databaseId = params.databaseId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + const apiPath = '/vectorsdb/{databaseId}'.replace('{databaseId}', databaseId); + 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 + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.name - Database name. Max length: 128 chars. + * @param {boolean} params.enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @throws {AppwriteException} + * @returns {Promise} + */ + update(params: { databaseId: string, name: string, enabled?: boolean }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} name - Database name. Max length: 128 chars. + * @param {boolean} enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + update(databaseId: string, name: string, enabled?: boolean): Promise; + update( + paramsOrFirst: { databaseId: string, name: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { databaseId: string, name: string, enabled?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean }; + } else { + params = { + databaseId: paramsOrFirst as string, + name: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const databaseId = params.databaseId; + const name = params.name; + const enabled = params.enabled; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/vectorsdb/{databaseId}'.replace('{databaseId}', databaseId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + delete(params: { databaseId: string }): Promise<{}>; + /** + * + * @param {string} databaseId - Database ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + delete(databaseId: string): Promise<{}>; + delete( + paramsOrFirst: { databaseId: string } | string + ): Promise<{}> { + let params: { databaseId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string }; + } else { + params = { + databaseId: paramsOrFirst as string + }; + } + + const databaseId = params.databaseId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + const apiPath = '/vectorsdb/{databaseId}'.replace('{databaseId}', databaseId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity + * @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} + */ + listCollections(params: { databaseId: string, queries?: string[], search?: string, total?: boolean }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity + * @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. + */ + listCollections(databaseId: string, queries?: string[], search?: string, total?: boolean): Promise; + listCollections( + paramsOrFirst: { databaseId: string, queries?: string[], search?: string, total?: boolean } | string, + ...rest: [(string[])?, (string)?, (boolean)?] + ): Promise { + let params: { databaseId: string, queries?: string[], search?: string, total?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, queries?: string[], search?: string, total?: boolean }; + } else { + params = { + databaseId: paramsOrFirst as string, + queries: rest[0] as string[], + search: rest[1] as string, + total: rest[2] as boolean + }; + } + + const databaseId = params.databaseId; + const queries = params.queries; + const search = params.search; + const total = params.total; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections'.replace('{databaseId}', databaseId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof search !== 'undefined') { + payload['search'] = search; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Collection name. Max length: 128 chars. + * @param {number} params.dimension - Embedding dimension. + * @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @throws {AppwriteException} + * @returns {Promise} + */ + createCollection(params: { databaseId: string, collectionId: string, name: string, dimension: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Collection name. Max length: 128 chars. + * @param {number} dimension - Embedding dimension. + * @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createCollection(databaseId: string, collectionId: string, name: string, dimension: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise; + createCollection( + paramsOrFirst: { databaseId: string, collectionId: string, name: string, dimension: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (number)?, (string[])?, (boolean)?, (boolean)?] + ): Promise { + let params: { databaseId: string, collectionId: string, name: string, dimension: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, name: string, dimension: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + name: rest[1] as string, + dimension: rest[2] as number, + permissions: rest[3] as string[], + documentSecurity: rest[4] as boolean, + enabled: rest[5] as boolean + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const name = params.name; + const dimension = params.dimension; + const permissions = params.permissions; + const documentSecurity = params.documentSecurity; + const enabled = params.enabled; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof dimension === 'undefined') { + throw new AppwriteException('Missing required parameter: "dimension"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections'.replace('{databaseId}', databaseId); + const payload: Payload = {}; + if (typeof collectionId !== 'undefined') { + payload['collectionId'] = collectionId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof dimension !== 'undefined') { + payload['dimension'] = dimension; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + if (typeof documentSecurity !== 'undefined') { + payload['documentSecurity'] = documentSecurity; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getCollection(params: { databaseId: string, collectionId: string }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getCollection(databaseId: string, collectionId: string): Promise; + getCollection( + paramsOrFirst: { databaseId: string, collectionId: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { databaseId: string, collectionId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + 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 + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.name - Collection name. Max length: 128 chars. + * @param {number} params.dimension - Embedding dimensions. + * @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateCollection(params: { databaseId: string, collectionId: string, name: string, dimension?: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} name - Collection name. Max length: 128 chars. + * @param {number} dimension - Embedding dimensions. + * @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateCollection(databaseId: string, collectionId: string, name: string, dimension?: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise; + updateCollection( + paramsOrFirst: { databaseId: string, collectionId: string, name: string, dimension?: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (number)?, (string[])?, (boolean)?, (boolean)?] + ): Promise { + let params: { databaseId: string, collectionId: string, name: string, dimension?: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, name: string, dimension?: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + name: rest[1] as string, + dimension: rest[2] as number, + permissions: rest[3] as string[], + documentSecurity: rest[4] as boolean, + enabled: rest[5] as boolean + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const name = params.name; + const dimension = params.dimension; + const permissions = params.permissions; + const documentSecurity = params.documentSecurity; + const enabled = params.enabled; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof dimension !== 'undefined') { + payload['dimension'] = dimension; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + if (typeof documentSecurity !== 'undefined') { + payload['documentSecurity'] = documentSecurity; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteCollection(params: { databaseId: string, collectionId: string }): Promise<{}>; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteCollection(databaseId: string, collectionId: string): Promise<{}>; + deleteCollection( + paramsOrFirst: { databaseId: string, collectionId: string } | string, + ...rest: [(string)?] + ): Promise<{}> { + let params: { databaseId: string, collectionId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @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. + * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise>} + */ + listDocuments(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }): Promise>; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @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. + * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listDocuments(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number): Promise>; + listDocuments( + paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number } | string, + ...rest: [(string)?, (string[])?, (string)?, (boolean)?, (number)?] + ): Promise> { + let params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + queries: rest[1] as string[], + transactionId: rest[2] as string, + total: rest[3] as boolean, + ttl: rest[4] as number + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const queries = params.queries; + const transactionId = params.transactionId; + const total = params.total; + const ttl = params.ttl; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + if (typeof ttl !== 'undefined') { + payload['ttl'] = ttl; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param {string} params.documentId - Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit} params.data - Document data as JSON object. + * @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @throws {AppwriteException} + * @returns {Promise} + */ + createDocument(params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[] }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param {string} documentId - Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit} data - Document data as JSON object. + * @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createDocument(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[]): Promise; + createDocument( + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[] } | string, + ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit)?, (string[])?] + ): Promise { + let params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[] }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + data: rest[2] as Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, + permissions: rest[3] as string[] + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const data = params.data; + const permissions = params.permissions; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + if (typeof data === 'undefined') { + throw new AppwriteException('Missing required parameter: "data"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof documentId !== 'undefined') { + payload['documentId'] = documentId; + } + if (typeof data !== 'undefined') { + payload['data'] = data; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param {object[]} params.documents - Array of documents data as JSON objects. + * @throws {AppwriteException} + * @returns {Promise>} + */ + createDocuments(params: { databaseId: string, collectionId: string, documents: object[] }): Promise>; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param {object[]} documents - Array of documents data as JSON objects. + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createDocuments(databaseId: string, collectionId: string, documents: object[]): Promise>; + createDocuments( + paramsOrFirst: { databaseId: string, collectionId: string, documents: object[] } | string, + ...rest: [(string)?, (object[])?] + ): Promise> { + let params: { databaseId: string, collectionId: string, documents: object[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documents: object[] }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documents: rest[1] as object[] + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documents = params.documents; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documents === 'undefined') { + throw new AppwriteException('Missing required parameter: "documents"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof documents !== 'undefined') { + payload['documents'] = documents; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {object[]} params.documents - Array of document data as JSON objects. May contain partial documents. + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise>} + */ + upsertDocuments(params: { databaseId: string, collectionId: string, documents: object[], transactionId?: string }): Promise>; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {object[]} documents - Array of document data as JSON objects. May contain partial documents. + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + upsertDocuments(databaseId: string, collectionId: string, documents: object[], transactionId?: string): Promise>; + upsertDocuments( + paramsOrFirst: { databaseId: string, collectionId: string, documents: object[], transactionId?: string } | string, + ...rest: [(string)?, (object[])?, (string)?] + ): Promise> { + let params: { databaseId: string, collectionId: string, documents: object[], transactionId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documents: object[], transactionId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documents: rest[1] as object[], + transactionId: rest[2] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documents = params.documents; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documents === 'undefined') { + throw new AppwriteException('Missing required parameter: "documents"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof documents !== 'undefined') { + payload['documents'] = documents; + } + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {object} params.data - Document data as JSON object. Include only attribute and value pairs to be updated. + * @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. + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise>} + */ + updateDocuments(params: { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string }): Promise>; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {object} data - Document data as JSON object. Include only attribute and value pairs to be updated. + * @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. + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateDocuments(databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string): Promise>; + updateDocuments( + paramsOrFirst: { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string } | string, + ...rest: [(string)?, (object)?, (string[])?, (string)?] + ): Promise> { + let params: { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + data: rest[1] as object, + queries: rest[2] as string[], + transactionId: rest[3] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const data = params.data; + const queries = params.queries; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof data !== 'undefined') { + payload['data'] = data; + } + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @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. + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise>} + */ + deleteDocuments(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string }): Promise>; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @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. + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteDocuments(databaseId: string, collectionId: string, queries?: string[], transactionId?: string): Promise>; + deleteDocuments( + paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string } | string, + ...rest: [(string)?, (string[])?, (string)?] + ): Promise> { + let params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], transactionId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + queries: rest[1] as string[], + transactionId: rest[2] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const queries = params.queries; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} params.documentId - Document ID. + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. + * @throws {AppwriteException} + * @returns {Promise} + */ + getDocument(params: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} documentId - Document ID. + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getDocument(databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string): Promise; + getDocument( + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string } | string, + ...rest: [(string)?, (string)?, (string[])?, (string)?] + ): Promise { + let params: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + queries: rest[2] as string[], + transactionId: rest[3] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const queries = params.queries; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.documentId - Document ID. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} params.data - Document data as JSON object. Include all required fields of the document to be created or updated. + * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + upsertDocument(params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} documentId - Document ID. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} data - Document data as JSON object. Include all required fields of the document to be created or updated. + * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + upsertDocument(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string): Promise; + upsertDocument( + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string } | string, + ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>)?, (string[])?, (string)?] + ): Promise { + let params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + data: rest[2] as Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, + permissions: rest[3] as string[], + transactionId: rest[4] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const data = params.data; + const permissions = params.permissions; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); + const payload: Payload = {}; + if (typeof data !== 'undefined') { + payload['data'] = data; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.documentId - Document ID. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} params.data - Document data as JSON object. Include only fields and value pairs to be updated. + * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateDocument(params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} documentId - Document ID. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} data - Document data as JSON object. Include only fields and value pairs to be updated. + * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateDocument(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string): Promise; + updateDocument( + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string } | string, + ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>)?, (string[])?, (string)?] + ): Promise { + let params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + data: rest[2] as Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, + permissions: rest[3] as string[], + transactionId: rest[4] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const data = params.data; + const permissions = params.permissions; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); + const payload: Payload = {}; + if (typeof data !== 'undefined') { + payload['data'] = data; + } + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} params.documentId - Document ID. + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteDocument(params: { databaseId: string, collectionId: string, documentId: string, transactionId?: string }): Promise<{}>; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} documentId - Document ID. + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteDocument(databaseId: string, collectionId: string, documentId: string, transactionId?: string): Promise<{}>; + deleteDocument( + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, transactionId?: string } | string, + ...rest: [(string)?, (string)?, (string)?] + ): Promise<{}> { + let params: { databaseId: string, collectionId: string, documentId: string, transactionId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, transactionId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + transactionId: rest[2] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); + const payload: Payload = {}; + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.documentId - Document ID. + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @throws {AppwriteException} + * @returns {Promise} + */ + listDocumentLogs(params: { databaseId: string, collectionId: string, documentId: string, queries?: string[] }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} documentId - Document ID. + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listDocumentLogs(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise; + listDocumentLogs( + paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, queries?: string[] } | string, + ...rest: [(string)?, (string)?, (string[])?] + ): Promise { + let params: { databaseId: string, collectionId: string, documentId: string, queries?: string[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, queries?: string[] }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + queries: rest[2] as string[] + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const queries = params.queries; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof documentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listIndexes(params: { databaseId: string, collectionId: string, queries?: string[], total?: boolean }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error + * @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. + */ + listIndexes(databaseId: string, collectionId: string, queries?: string[], total?: boolean): Promise; + listIndexes( + paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], total?: boolean } | string, + ...rest: [(string)?, (string[])?, (boolean)?] + ): Promise { + let params: { databaseId: string, collectionId: string, queries?: string[], total?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], total?: boolean }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + queries: rest[1] as string[], + total: rest[2] as boolean + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const queries = params.queries; + const total = params.total; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} params.key - Index Key. + * @param {VectorsDBIndexType} params.type - Index type. + * @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. + * @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed. + * @param {number[]} params.lengths - Length of index. Maximum of 100 + * @throws {AppwriteException} + * @returns {Promise} + */ + createIndex(params: { databaseId: string, collectionId: string, key: string, type: VectorsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} key - Index Key. + * @param {VectorsDBIndexType} type - Index type. + * @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. + * @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed. + * @param {number[]} lengths - Length of index. Maximum of 100 + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createIndex(databaseId: string, collectionId: string, key: string, type: VectorsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[]): Promise; + createIndex( + paramsOrFirst: { databaseId: string, collectionId: string, key: string, type: VectorsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] } | string, + ...rest: [(string)?, (string)?, (VectorsDBIndexType)?, (string[])?, (OrderBy[])?, (number[])?] + ): Promise { + let params: { databaseId: string, collectionId: string, key: string, type: VectorsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, type: VectorsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + key: rest[1] as string, + type: rest[2] as VectorsDBIndexType, + attributes: rest[3] as string[], + orders: rest[4] as OrderBy[], + lengths: rest[5] as number[] + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const key = params.key; + const type = params.type; + const attributes = params.attributes; + const orders = params.orders; + const lengths = params.lengths; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + if (typeof type === 'undefined') { + throw new AppwriteException('Missing required parameter: "type"'); + } + if (typeof attributes === 'undefined') { + throw new AppwriteException('Missing required parameter: "attributes"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof type !== 'undefined') { + payload['type'] = type; + } + if (typeof attributes !== 'undefined') { + payload['attributes'] = attributes; + } + if (typeof orders !== 'undefined') { + payload['orders'] = orders; + } + if (typeof lengths !== 'undefined') { + payload['lengths'] = lengths; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} params.key - Index Key. + * @throws {AppwriteException} + * @returns {Promise} + */ + getIndex(params: { databaseId: string, collectionId: string, key: string }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} key - Index Key. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getIndex(databaseId: string, collectionId: string, key: string): Promise; + getIndex( + paramsOrFirst: { databaseId: string, collectionId: string, key: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { databaseId: string, collectionId: string, key: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + key: rest[1] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const key = params.key; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + 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 + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} params.key - Index Key. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteIndex(params: { databaseId: string, collectionId: string, key: string }): Promise<{}>; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @param {string} key - Index Key. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteIndex(databaseId: string, collectionId: string, key: string): Promise<{}>; + deleteIndex( + paramsOrFirst: { databaseId: string, collectionId: string, key: string } | string, + ...rest: [(string)?, (string)?] + ): Promise<{}> { + let params: { databaseId: string, collectionId: string, key: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + key: rest[1] as string + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const key = params.key; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @throws {AppwriteException} + * @returns {Promise} + */ + listCollectionLogs(params: { databaseId: string, collectionId: string, queries?: string[] }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listCollectionLogs(databaseId: string, collectionId: string, queries?: string[]): Promise; + listCollectionLogs( + paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[] } | string, + ...rest: [(string)?, (string[])?] + ): Promise { + let params: { databaseId: string, collectionId: string, queries?: string[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[] }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + queries: rest[1] as string[] + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const queries = params.queries; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {UsageRange} params.range - Date range. + * @throws {AppwriteException} + * @returns {Promise} + */ + getCollectionUsage(params: { databaseId: string, collectionId: string, range?: UsageRange }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {UsageRange} range - Date range. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getCollectionUsage(databaseId: string, collectionId: string, range?: UsageRange): Promise; + getCollectionUsage( + paramsOrFirst: { databaseId: string, collectionId: string, range?: UsageRange } | string, + ...rest: [(string)?, (UsageRange)?] + ): Promise { + let params: { databaseId: string, collectionId: string, range?: UsageRange }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, range?: UsageRange }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + range: rest[1] as UsageRange + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const range = params.range; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof collectionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + + const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/usage'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof range !== 'undefined') { + payload['range'] = range; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } + + /** + * + * @param {string} params.databaseId - Database ID. + * @param {UsageRange} params.range - Date range. + * @throws {AppwriteException} + * @returns {Promise} + */ + getUsage(params: { databaseId: string, range?: UsageRange }): Promise; + /** + * + * @param {string} databaseId - Database ID. + * @param {UsageRange} range - Date range. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getUsage(databaseId: string, range?: UsageRange): Promise; + getUsage( + paramsOrFirst: { databaseId: string, range?: UsageRange } | string, + ...rest: [(UsageRange)?] + ): Promise { + let params: { databaseId: string, range?: UsageRange }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, range?: UsageRange }; + } else { + params = { + databaseId: paramsOrFirst as string, + range: rest[0] as UsageRange + }; + } + + const databaseId = params.databaseId; + const range = params.range; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + const apiPath = '/vectorsdb/{databaseId}/usage'.replace('{databaseId}', databaseId); + const payload: Payload = {}; + if (typeof range !== 'undefined') { + payload['range'] = range; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } +} From de8810e7d3921dc4b89fc7b02255ca536c35af18 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Mar 2026 04:23:28 +0000 Subject: [PATCH 2/9] chore: update Console SDK to 7.0.0 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee7e83c4..7f2e2a90 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).** +**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).** Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Console SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) From 1812e607aff06a9de087250a5e4d94d17daaa727 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Mar 2026 05:25:34 +0000 Subject: [PATCH 3/9] chore: update Console SDK to 7.0.0 --- .../examples/documentsdb/create-collection.md | 22 - docs/examples/documentsdb/create-document.md | 25 - docs/examples/documentsdb/create-documents.md | 17 - docs/examples/documentsdb/create-index.md | 21 - .../documentsdb/create-transaction.md | 15 - docs/examples/documentsdb/create.md | 17 - .../decrement-document-attribute.md | 21 - .../examples/documentsdb/delete-collection.md | 16 - docs/examples/documentsdb/delete-document.md | 18 - docs/examples/documentsdb/delete-documents.md | 18 - docs/examples/documentsdb/delete-index.md | 17 - .../documentsdb/delete-transaction.md | 15 - docs/examples/documentsdb/delete.md | 15 - .../documentsdb/get-collection-usage.md | 17 - docs/examples/documentsdb/get-collection.md | 16 - docs/examples/documentsdb/get-document.md | 19 - docs/examples/documentsdb/get-index.md | 17 - docs/examples/documentsdb/get-transaction.md | 15 - docs/examples/documentsdb/get-usage.md | 16 - docs/examples/documentsdb/get.md | 15 - .../increment-document-attribute.md | 21 - .../documentsdb/list-collection-logs.md | 17 - docs/examples/documentsdb/list-collections.md | 18 - .../documentsdb/list-document-logs.md | 18 - docs/examples/documentsdb/list-documents.md | 20 - docs/examples/documentsdb/list-indexes.md | 18 - .../examples/documentsdb/list-transactions.md | 15 - docs/examples/documentsdb/list-usage.md | 15 - docs/examples/documentsdb/list.md | 17 - .../examples/documentsdb/update-collection.md | 20 - docs/examples/documentsdb/update-document.md | 20 - docs/examples/documentsdb/update-documents.md | 19 - .../documentsdb/update-transaction.md | 17 - docs/examples/documentsdb/update.md | 17 - docs/examples/documentsdb/upsert-document.md | 20 - docs/examples/documentsdb/upsert-documents.md | 18 - docs/examples/vectorsdb/create-collection.md | 21 - docs/examples/vectorsdb/create-document.md | 29 - docs/examples/vectorsdb/create-documents.md | 17 - docs/examples/vectorsdb/create-index.md | 21 - docs/examples/vectorsdb/create-operations.md | 26 - .../vectorsdb/create-text-embeddings.md | 16 - docs/examples/vectorsdb/create-transaction.md | 15 - docs/examples/vectorsdb/create.md | 17 - docs/examples/vectorsdb/delete-collection.md | 16 - docs/examples/vectorsdb/delete-document.md | 18 - docs/examples/vectorsdb/delete-documents.md | 18 - docs/examples/vectorsdb/delete-index.md | 17 - docs/examples/vectorsdb/delete-transaction.md | 15 - docs/examples/vectorsdb/delete.md | 15 - .../vectorsdb/get-collection-usage.md | 17 - docs/examples/vectorsdb/get-collection.md | 16 - docs/examples/vectorsdb/get-document.md | 19 - docs/examples/vectorsdb/get-index.md | 17 - docs/examples/vectorsdb/get-transaction.md | 15 - docs/examples/vectorsdb/get-usage.md | 16 - docs/examples/vectorsdb/get.md | 15 - .../vectorsdb/list-collection-logs.md | 17 - docs/examples/vectorsdb/list-collections.md | 18 - docs/examples/vectorsdb/list-document-logs.md | 18 - docs/examples/vectorsdb/list-documents.md | 20 - docs/examples/vectorsdb/list-indexes.md | 18 - docs/examples/vectorsdb/list-transactions.md | 15 - docs/examples/vectorsdb/list-usage.md | 15 - docs/examples/vectorsdb/list.md | 17 - docs/examples/vectorsdb/update-collection.md | 21 - docs/examples/vectorsdb/update-document.md | 20 - docs/examples/vectorsdb/update-documents.md | 19 - docs/examples/vectorsdb/update-transaction.md | 17 - docs/examples/vectorsdb/update.md | 17 - docs/examples/vectorsdb/upsert-document.md | 20 - docs/examples/vectorsdb/upsert-documents.md | 18 - src/index.ts | 2 - src/services/documents-db.ts | 2608 ----------------- src/services/vectors-db.ts | 2477 ---------------- 75 files changed, 6375 deletions(-) delete mode 100644 docs/examples/documentsdb/create-collection.md delete mode 100644 docs/examples/documentsdb/create-document.md delete mode 100644 docs/examples/documentsdb/create-documents.md delete mode 100644 docs/examples/documentsdb/create-index.md delete mode 100644 docs/examples/documentsdb/create-transaction.md delete mode 100644 docs/examples/documentsdb/create.md delete mode 100644 docs/examples/documentsdb/decrement-document-attribute.md delete mode 100644 docs/examples/documentsdb/delete-collection.md delete mode 100644 docs/examples/documentsdb/delete-document.md delete mode 100644 docs/examples/documentsdb/delete-documents.md delete mode 100644 docs/examples/documentsdb/delete-index.md delete mode 100644 docs/examples/documentsdb/delete-transaction.md delete mode 100644 docs/examples/documentsdb/delete.md delete mode 100644 docs/examples/documentsdb/get-collection-usage.md delete mode 100644 docs/examples/documentsdb/get-collection.md delete mode 100644 docs/examples/documentsdb/get-document.md delete mode 100644 docs/examples/documentsdb/get-index.md delete mode 100644 docs/examples/documentsdb/get-transaction.md delete mode 100644 docs/examples/documentsdb/get-usage.md delete mode 100644 docs/examples/documentsdb/get.md delete mode 100644 docs/examples/documentsdb/increment-document-attribute.md delete mode 100644 docs/examples/documentsdb/list-collection-logs.md delete mode 100644 docs/examples/documentsdb/list-collections.md delete mode 100644 docs/examples/documentsdb/list-document-logs.md delete mode 100644 docs/examples/documentsdb/list-documents.md delete mode 100644 docs/examples/documentsdb/list-indexes.md delete mode 100644 docs/examples/documentsdb/list-transactions.md delete mode 100644 docs/examples/documentsdb/list-usage.md delete mode 100644 docs/examples/documentsdb/list.md delete mode 100644 docs/examples/documentsdb/update-collection.md delete mode 100644 docs/examples/documentsdb/update-document.md delete mode 100644 docs/examples/documentsdb/update-documents.md delete mode 100644 docs/examples/documentsdb/update-transaction.md delete mode 100644 docs/examples/documentsdb/update.md delete mode 100644 docs/examples/documentsdb/upsert-document.md delete mode 100644 docs/examples/documentsdb/upsert-documents.md delete mode 100644 docs/examples/vectorsdb/create-collection.md delete mode 100644 docs/examples/vectorsdb/create-document.md delete mode 100644 docs/examples/vectorsdb/create-documents.md delete mode 100644 docs/examples/vectorsdb/create-index.md delete mode 100644 docs/examples/vectorsdb/create-operations.md delete mode 100644 docs/examples/vectorsdb/create-text-embeddings.md delete mode 100644 docs/examples/vectorsdb/create-transaction.md delete mode 100644 docs/examples/vectorsdb/create.md delete mode 100644 docs/examples/vectorsdb/delete-collection.md delete mode 100644 docs/examples/vectorsdb/delete-document.md delete mode 100644 docs/examples/vectorsdb/delete-documents.md delete mode 100644 docs/examples/vectorsdb/delete-index.md delete mode 100644 docs/examples/vectorsdb/delete-transaction.md delete mode 100644 docs/examples/vectorsdb/delete.md delete mode 100644 docs/examples/vectorsdb/get-collection-usage.md delete mode 100644 docs/examples/vectorsdb/get-collection.md delete mode 100644 docs/examples/vectorsdb/get-document.md delete mode 100644 docs/examples/vectorsdb/get-index.md delete mode 100644 docs/examples/vectorsdb/get-transaction.md delete mode 100644 docs/examples/vectorsdb/get-usage.md delete mode 100644 docs/examples/vectorsdb/get.md delete mode 100644 docs/examples/vectorsdb/list-collection-logs.md delete mode 100644 docs/examples/vectorsdb/list-collections.md delete mode 100644 docs/examples/vectorsdb/list-document-logs.md delete mode 100644 docs/examples/vectorsdb/list-documents.md delete mode 100644 docs/examples/vectorsdb/list-indexes.md delete mode 100644 docs/examples/vectorsdb/list-transactions.md delete mode 100644 docs/examples/vectorsdb/list-usage.md delete mode 100644 docs/examples/vectorsdb/list.md delete mode 100644 docs/examples/vectorsdb/update-collection.md delete mode 100644 docs/examples/vectorsdb/update-document.md delete mode 100644 docs/examples/vectorsdb/update-documents.md delete mode 100644 docs/examples/vectorsdb/update-transaction.md delete mode 100644 docs/examples/vectorsdb/update.md delete mode 100644 docs/examples/vectorsdb/upsert-document.md delete mode 100644 docs/examples/vectorsdb/upsert-documents.md delete mode 100644 src/services/documents-db.ts delete mode 100644 src/services/vectors-db.ts diff --git a/docs/examples/documentsdb/create-collection.md b/docs/examples/documentsdb/create-collection.md deleted file mode 100644 index a1312824..00000000 --- a/docs/examples/documentsdb/create-collection.md +++ /dev/null @@ -1,22 +0,0 @@ -```javascript -import { Client, DocumentsDB, Permission, Role } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.createCollection({ - databaseId: '', - collectionId: '', - name: '', - permissions: [Permission.read(Role.any())], // optional - documentSecurity: false, // optional - enabled: false, // optional - attributes: [], // optional - indexes: [] // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/create-document.md b/docs/examples/documentsdb/create-document.md deleted file mode 100644 index a628708e..00000000 --- a/docs/examples/documentsdb/create-document.md +++ /dev/null @@ -1,25 +0,0 @@ -```javascript -import { Client, DocumentsDB, Permission, Role } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.createDocument({ - databaseId: '', - collectionId: '', - documentId: '', - data: { - "username": "walter.obrien", - "email": "walter.obrien@example.com", - "fullName": "Walter O'Brien", - "age": 30, - "isAdmin": false - }, - permissions: [Permission.read(Role.any())] // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/create-documents.md b/docs/examples/documentsdb/create-documents.md deleted file mode 100644 index 3880bb7e..00000000 --- a/docs/examples/documentsdb/create-documents.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.createDocuments({ - databaseId: '', - collectionId: '', - documents: [] -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/create-index.md b/docs/examples/documentsdb/create-index.md deleted file mode 100644 index d28785a0..00000000 --- a/docs/examples/documentsdb/create-index.md +++ /dev/null @@ -1,21 +0,0 @@ -```javascript -import { Client, DocumentsDB, DocumentsDBIndexType, OrderBy } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.createIndex({ - databaseId: '', - collectionId: '', - key: '', - type: DocumentsDBIndexType.Key, - attributes: [], - orders: [OrderBy.Asc], // optional - lengths: [] // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/create-transaction.md b/docs/examples/documentsdb/create-transaction.md deleted file mode 100644 index a5854097..00000000 --- a/docs/examples/documentsdb/create-transaction.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.createTransaction({ - ttl: 60 // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/create.md b/docs/examples/documentsdb/create.md deleted file mode 100644 index a0cc85ab..00000000 --- a/docs/examples/documentsdb/create.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.create({ - databaseId: '', - name: '', - enabled: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/decrement-document-attribute.md b/docs/examples/documentsdb/decrement-document-attribute.md deleted file mode 100644 index 873df72b..00000000 --- a/docs/examples/documentsdb/decrement-document-attribute.md +++ /dev/null @@ -1,21 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.decrementDocumentAttribute({ - databaseId: '', - collectionId: '', - documentId: '', - attribute: '', - value: null, // optional - min: null, // optional - transactionId: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/delete-collection.md b/docs/examples/documentsdb/delete-collection.md deleted file mode 100644 index 708c1e4e..00000000 --- a/docs/examples/documentsdb/delete-collection.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.deleteCollection({ - databaseId: '', - collectionId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/delete-document.md b/docs/examples/documentsdb/delete-document.md deleted file mode 100644 index 272379d1..00000000 --- a/docs/examples/documentsdb/delete-document.md +++ /dev/null @@ -1,18 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.deleteDocument({ - databaseId: '', - collectionId: '', - documentId: '', - transactionId: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/delete-documents.md b/docs/examples/documentsdb/delete-documents.md deleted file mode 100644 index 5aae827f..00000000 --- a/docs/examples/documentsdb/delete-documents.md +++ /dev/null @@ -1,18 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.deleteDocuments({ - databaseId: '', - collectionId: '', - queries: [], // optional - transactionId: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/delete-index.md b/docs/examples/documentsdb/delete-index.md deleted file mode 100644 index a36bff9f..00000000 --- a/docs/examples/documentsdb/delete-index.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.deleteIndex({ - databaseId: '', - collectionId: '', - key: '' -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/delete-transaction.md b/docs/examples/documentsdb/delete-transaction.md deleted file mode 100644 index a22112d8..00000000 --- a/docs/examples/documentsdb/delete-transaction.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.deleteTransaction({ - transactionId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/delete.md b/docs/examples/documentsdb/delete.md deleted file mode 100644 index 40e50d61..00000000 --- a/docs/examples/documentsdb/delete.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.delete({ - databaseId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/get-collection-usage.md b/docs/examples/documentsdb/get-collection-usage.md deleted file mode 100644 index 10c473c8..00000000 --- a/docs/examples/documentsdb/get-collection-usage.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, DocumentsDB, UsageRange } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.getCollectionUsage({ - databaseId: '', - collectionId: '', - range: UsageRange.TwentyFourHours // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/get-collection.md b/docs/examples/documentsdb/get-collection.md deleted file mode 100644 index 6179e8c5..00000000 --- a/docs/examples/documentsdb/get-collection.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.getCollection({ - databaseId: '', - collectionId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/get-document.md b/docs/examples/documentsdb/get-document.md deleted file mode 100644 index 916fe5c2..00000000 --- a/docs/examples/documentsdb/get-document.md +++ /dev/null @@ -1,19 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.getDocument({ - databaseId: '', - collectionId: '', - documentId: '', - queries: [], // optional - transactionId: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/get-index.md b/docs/examples/documentsdb/get-index.md deleted file mode 100644 index 0e971cb1..00000000 --- a/docs/examples/documentsdb/get-index.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.getIndex({ - databaseId: '', - collectionId: '', - key: '' -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/get-transaction.md b/docs/examples/documentsdb/get-transaction.md deleted file mode 100644 index 18217485..00000000 --- a/docs/examples/documentsdb/get-transaction.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.getTransaction({ - transactionId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/get-usage.md b/docs/examples/documentsdb/get-usage.md deleted file mode 100644 index 79428904..00000000 --- a/docs/examples/documentsdb/get-usage.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -import { Client, DocumentsDB, UsageRange } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.getUsage({ - databaseId: '', - range: UsageRange.TwentyFourHours // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/get.md b/docs/examples/documentsdb/get.md deleted file mode 100644 index 6c1392bd..00000000 --- a/docs/examples/documentsdb/get.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.get({ - databaseId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/increment-document-attribute.md b/docs/examples/documentsdb/increment-document-attribute.md deleted file mode 100644 index ba4f2e1d..00000000 --- a/docs/examples/documentsdb/increment-document-attribute.md +++ /dev/null @@ -1,21 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.incrementDocumentAttribute({ - databaseId: '', - collectionId: '', - documentId: '', - attribute: '', - value: null, // optional - max: null, // optional - transactionId: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/list-collection-logs.md b/docs/examples/documentsdb/list-collection-logs.md deleted file mode 100644 index eed2919c..00000000 --- a/docs/examples/documentsdb/list-collection-logs.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.listCollectionLogs({ - databaseId: '', - collectionId: '', - queries: [] // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/list-collections.md b/docs/examples/documentsdb/list-collections.md deleted file mode 100644 index 340dbd5a..00000000 --- a/docs/examples/documentsdb/list-collections.md +++ /dev/null @@ -1,18 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.listCollections({ - databaseId: '', - queries: [], // optional - search: '', // optional - total: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/list-document-logs.md b/docs/examples/documentsdb/list-document-logs.md deleted file mode 100644 index 25897c11..00000000 --- a/docs/examples/documentsdb/list-document-logs.md +++ /dev/null @@ -1,18 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.listDocumentLogs({ - databaseId: '', - collectionId: '', - documentId: '', - queries: [] // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/list-documents.md b/docs/examples/documentsdb/list-documents.md deleted file mode 100644 index fc9d443f..00000000 --- a/docs/examples/documentsdb/list-documents.md +++ /dev/null @@ -1,20 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.listDocuments({ - databaseId: '', - collectionId: '', - queries: [], // optional - transactionId: '', // optional - total: false, // optional - ttl: 0 // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/list-indexes.md b/docs/examples/documentsdb/list-indexes.md deleted file mode 100644 index 43891aca..00000000 --- a/docs/examples/documentsdb/list-indexes.md +++ /dev/null @@ -1,18 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.listIndexes({ - databaseId: '', - collectionId: '', - queries: [], // optional - total: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/list-transactions.md b/docs/examples/documentsdb/list-transactions.md deleted file mode 100644 index 6a291601..00000000 --- a/docs/examples/documentsdb/list-transactions.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.listTransactions({ - queries: [] // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/list-usage.md b/docs/examples/documentsdb/list-usage.md deleted file mode 100644 index 300192ea..00000000 --- a/docs/examples/documentsdb/list-usage.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, DocumentsDB, UsageRange } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.listUsage({ - range: UsageRange.TwentyFourHours // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/list.md b/docs/examples/documentsdb/list.md deleted file mode 100644 index fa0cd866..00000000 --- a/docs/examples/documentsdb/list.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.list({ - queries: [], // optional - search: '', // optional - total: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/update-collection.md b/docs/examples/documentsdb/update-collection.md deleted file mode 100644 index d0eb689c..00000000 --- a/docs/examples/documentsdb/update-collection.md +++ /dev/null @@ -1,20 +0,0 @@ -```javascript -import { Client, DocumentsDB, Permission, Role } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.updateCollection({ - databaseId: '', - collectionId: '', - name: '', - permissions: [Permission.read(Role.any())], // optional - documentSecurity: false, // optional - enabled: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/update-document.md b/docs/examples/documentsdb/update-document.md deleted file mode 100644 index 66d09372..00000000 --- a/docs/examples/documentsdb/update-document.md +++ /dev/null @@ -1,20 +0,0 @@ -```javascript -import { Client, DocumentsDB, Permission, Role } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.updateDocument({ - databaseId: '', - collectionId: '', - documentId: '', - data: {}, // optional - permissions: [Permission.read(Role.any())], // optional - transactionId: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/update-documents.md b/docs/examples/documentsdb/update-documents.md deleted file mode 100644 index f41af221..00000000 --- a/docs/examples/documentsdb/update-documents.md +++ /dev/null @@ -1,19 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.updateDocuments({ - databaseId: '', - collectionId: '', - data: {}, // optional - queries: [], // optional - transactionId: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/update-transaction.md b/docs/examples/documentsdb/update-transaction.md deleted file mode 100644 index 1c4daa45..00000000 --- a/docs/examples/documentsdb/update-transaction.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.updateTransaction({ - transactionId: '', - commit: false, // optional - rollback: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/update.md b/docs/examples/documentsdb/update.md deleted file mode 100644 index 24be2117..00000000 --- a/docs/examples/documentsdb/update.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.update({ - databaseId: '', - name: '', - enabled: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/upsert-document.md b/docs/examples/documentsdb/upsert-document.md deleted file mode 100644 index 465d1bac..00000000 --- a/docs/examples/documentsdb/upsert-document.md +++ /dev/null @@ -1,20 +0,0 @@ -```javascript -import { Client, DocumentsDB, Permission, Role } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.upsertDocument({ - databaseId: '', - collectionId: '', - documentId: '', - data: {}, // optional - permissions: [Permission.read(Role.any())], // optional - transactionId: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/documentsdb/upsert-documents.md b/docs/examples/documentsdb/upsert-documents.md deleted file mode 100644 index d67e350a..00000000 --- a/docs/examples/documentsdb/upsert-documents.md +++ /dev/null @@ -1,18 +0,0 @@ -```javascript -import { Client, DocumentsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const documentsDB = new DocumentsDB(client); - -const result = await documentsDB.upsertDocuments({ - databaseId: '', - collectionId: '', - documents: [], - transactionId: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/create-collection.md b/docs/examples/vectorsdb/create-collection.md deleted file mode 100644 index 43924d6b..00000000 --- a/docs/examples/vectorsdb/create-collection.md +++ /dev/null @@ -1,21 +0,0 @@ -```javascript -import { Client, VectorsDB, Permission, Role } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.createCollection({ - databaseId: '', - collectionId: '', - name: '', - dimension: 1, - permissions: [Permission.read(Role.any())], // optional - documentSecurity: false, // optional - enabled: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/create-document.md b/docs/examples/vectorsdb/create-document.md deleted file mode 100644 index 85067168..00000000 --- a/docs/examples/vectorsdb/create-document.md +++ /dev/null @@ -1,29 +0,0 @@ -```javascript -import { Client, VectorsDB, Permission, Role } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.createDocument({ - databaseId: '', - collectionId: '', - documentId: '', - data: { - "embeddings": [ - 0.12, - -0.55, - 0.88, - 1.02 - ], - "metadata": { - "key": "value" - } - }, - permissions: [Permission.read(Role.any())] // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/create-documents.md b/docs/examples/vectorsdb/create-documents.md deleted file mode 100644 index 4f955e88..00000000 --- a/docs/examples/vectorsdb/create-documents.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.createDocuments({ - databaseId: '', - collectionId: '', - documents: [] -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/create-index.md b/docs/examples/vectorsdb/create-index.md deleted file mode 100644 index 7bef86ed..00000000 --- a/docs/examples/vectorsdb/create-index.md +++ /dev/null @@ -1,21 +0,0 @@ -```javascript -import { Client, VectorsDB, VectorsDBIndexType, OrderBy } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.createIndex({ - databaseId: '', - collectionId: '', - key: '', - type: VectorsDBIndexType.HnswEuclidean, - attributes: [], - orders: [OrderBy.Asc], // optional - lengths: [] // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/create-operations.md b/docs/examples/vectorsdb/create-operations.md deleted file mode 100644 index 5ff5f687..00000000 --- a/docs/examples/vectorsdb/create-operations.md +++ /dev/null @@ -1,26 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.createOperations({ - transactionId: '', - operations: [ - { - "action": "create", - "databaseId": "", - "collectionId": "", - "documentId": "", - "data": { - "name": "Walter O'Brien" - } - } - ] // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/create-text-embeddings.md b/docs/examples/vectorsdb/create-text-embeddings.md deleted file mode 100644 index e024b563..00000000 --- a/docs/examples/vectorsdb/create-text-embeddings.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -import { Client, VectorsDB, Model } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.createTextEmbeddings({ - texts: [], - model: Model.Embeddinggemma // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/create-transaction.md b/docs/examples/vectorsdb/create-transaction.md deleted file mode 100644 index 99ee2ff6..00000000 --- a/docs/examples/vectorsdb/create-transaction.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.createTransaction({ - ttl: 60 // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/create.md b/docs/examples/vectorsdb/create.md deleted file mode 100644 index d37467a0..00000000 --- a/docs/examples/vectorsdb/create.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.create({ - databaseId: '', - name: '', - enabled: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/delete-collection.md b/docs/examples/vectorsdb/delete-collection.md deleted file mode 100644 index bc7997f9..00000000 --- a/docs/examples/vectorsdb/delete-collection.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.deleteCollection({ - databaseId: '', - collectionId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/delete-document.md b/docs/examples/vectorsdb/delete-document.md deleted file mode 100644 index a1db5dea..00000000 --- a/docs/examples/vectorsdb/delete-document.md +++ /dev/null @@ -1,18 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.deleteDocument({ - databaseId: '', - collectionId: '', - documentId: '', - transactionId: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/delete-documents.md b/docs/examples/vectorsdb/delete-documents.md deleted file mode 100644 index 92d6c8a6..00000000 --- a/docs/examples/vectorsdb/delete-documents.md +++ /dev/null @@ -1,18 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.deleteDocuments({ - databaseId: '', - collectionId: '', - queries: [], // optional - transactionId: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/delete-index.md b/docs/examples/vectorsdb/delete-index.md deleted file mode 100644 index b592d682..00000000 --- a/docs/examples/vectorsdb/delete-index.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.deleteIndex({ - databaseId: '', - collectionId: '', - key: '' -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/delete-transaction.md b/docs/examples/vectorsdb/delete-transaction.md deleted file mode 100644 index 12a21357..00000000 --- a/docs/examples/vectorsdb/delete-transaction.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.deleteTransaction({ - transactionId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/delete.md b/docs/examples/vectorsdb/delete.md deleted file mode 100644 index 768bf7bc..00000000 --- a/docs/examples/vectorsdb/delete.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.delete({ - databaseId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/get-collection-usage.md b/docs/examples/vectorsdb/get-collection-usage.md deleted file mode 100644 index b41c7ab2..00000000 --- a/docs/examples/vectorsdb/get-collection-usage.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, VectorsDB, UsageRange } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.getCollectionUsage({ - databaseId: '', - collectionId: '', - range: UsageRange.TwentyFourHours // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/get-collection.md b/docs/examples/vectorsdb/get-collection.md deleted file mode 100644 index 440adca2..00000000 --- a/docs/examples/vectorsdb/get-collection.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.getCollection({ - databaseId: '', - collectionId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/get-document.md b/docs/examples/vectorsdb/get-document.md deleted file mode 100644 index c3ecc577..00000000 --- a/docs/examples/vectorsdb/get-document.md +++ /dev/null @@ -1,19 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.getDocument({ - databaseId: '', - collectionId: '', - documentId: '', - queries: [], // optional - transactionId: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/get-index.md b/docs/examples/vectorsdb/get-index.md deleted file mode 100644 index 08930cfe..00000000 --- a/docs/examples/vectorsdb/get-index.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.getIndex({ - databaseId: '', - collectionId: '', - key: '' -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/get-transaction.md b/docs/examples/vectorsdb/get-transaction.md deleted file mode 100644 index 80c1ab82..00000000 --- a/docs/examples/vectorsdb/get-transaction.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.getTransaction({ - transactionId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/get-usage.md b/docs/examples/vectorsdb/get-usage.md deleted file mode 100644 index 91bf3b29..00000000 --- a/docs/examples/vectorsdb/get-usage.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -import { Client, VectorsDB, UsageRange } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.getUsage({ - databaseId: '', - range: UsageRange.TwentyFourHours // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/get.md b/docs/examples/vectorsdb/get.md deleted file mode 100644 index b7c5f5ac..00000000 --- a/docs/examples/vectorsdb/get.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.get({ - databaseId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/list-collection-logs.md b/docs/examples/vectorsdb/list-collection-logs.md deleted file mode 100644 index c997889b..00000000 --- a/docs/examples/vectorsdb/list-collection-logs.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.listCollectionLogs({ - databaseId: '', - collectionId: '', - queries: [] // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/list-collections.md b/docs/examples/vectorsdb/list-collections.md deleted file mode 100644 index dd4f27fb..00000000 --- a/docs/examples/vectorsdb/list-collections.md +++ /dev/null @@ -1,18 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.listCollections({ - databaseId: '', - queries: [], // optional - search: '', // optional - total: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/list-document-logs.md b/docs/examples/vectorsdb/list-document-logs.md deleted file mode 100644 index 5dd3e626..00000000 --- a/docs/examples/vectorsdb/list-document-logs.md +++ /dev/null @@ -1,18 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.listDocumentLogs({ - databaseId: '', - collectionId: '', - documentId: '', - queries: [] // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/list-documents.md b/docs/examples/vectorsdb/list-documents.md deleted file mode 100644 index 8b907aad..00000000 --- a/docs/examples/vectorsdb/list-documents.md +++ /dev/null @@ -1,20 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.listDocuments({ - databaseId: '', - collectionId: '', - queries: [], // optional - transactionId: '', // optional - total: false, // optional - ttl: 0 // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/list-indexes.md b/docs/examples/vectorsdb/list-indexes.md deleted file mode 100644 index eeeddb5c..00000000 --- a/docs/examples/vectorsdb/list-indexes.md +++ /dev/null @@ -1,18 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.listIndexes({ - databaseId: '', - collectionId: '', - queries: [], // optional - total: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/list-transactions.md b/docs/examples/vectorsdb/list-transactions.md deleted file mode 100644 index 21edf97c..00000000 --- a/docs/examples/vectorsdb/list-transactions.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.listTransactions({ - queries: [] // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/list-usage.md b/docs/examples/vectorsdb/list-usage.md deleted file mode 100644 index 75f0eb0b..00000000 --- a/docs/examples/vectorsdb/list-usage.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, VectorsDB, UsageRange } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.listUsage({ - range: UsageRange.TwentyFourHours // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/list.md b/docs/examples/vectorsdb/list.md deleted file mode 100644 index e7649d01..00000000 --- a/docs/examples/vectorsdb/list.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.list({ - queries: [], // optional - search: '', // optional - total: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/update-collection.md b/docs/examples/vectorsdb/update-collection.md deleted file mode 100644 index 2cbc7d5a..00000000 --- a/docs/examples/vectorsdb/update-collection.md +++ /dev/null @@ -1,21 +0,0 @@ -```javascript -import { Client, VectorsDB, Permission, Role } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.updateCollection({ - databaseId: '', - collectionId: '', - name: '', - dimension: 1, // optional - permissions: [Permission.read(Role.any())], // optional - documentSecurity: false, // optional - enabled: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/update-document.md b/docs/examples/vectorsdb/update-document.md deleted file mode 100644 index ce990ad6..00000000 --- a/docs/examples/vectorsdb/update-document.md +++ /dev/null @@ -1,20 +0,0 @@ -```javascript -import { Client, VectorsDB, Permission, Role } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.updateDocument({ - databaseId: '', - collectionId: '', - documentId: '', - data: {}, // optional - permissions: [Permission.read(Role.any())], // optional - transactionId: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/update-documents.md b/docs/examples/vectorsdb/update-documents.md deleted file mode 100644 index 44c19fb4..00000000 --- a/docs/examples/vectorsdb/update-documents.md +++ /dev/null @@ -1,19 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.updateDocuments({ - databaseId: '', - collectionId: '', - data: {}, // optional - queries: [], // optional - transactionId: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/update-transaction.md b/docs/examples/vectorsdb/update-transaction.md deleted file mode 100644 index a7809df7..00000000 --- a/docs/examples/vectorsdb/update-transaction.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.updateTransaction({ - transactionId: '', - commit: false, // optional - rollback: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/update.md b/docs/examples/vectorsdb/update.md deleted file mode 100644 index c0fc980b..00000000 --- a/docs/examples/vectorsdb/update.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.update({ - databaseId: '', - name: '', - enabled: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/upsert-document.md b/docs/examples/vectorsdb/upsert-document.md deleted file mode 100644 index 1221bad1..00000000 --- a/docs/examples/vectorsdb/upsert-document.md +++ /dev/null @@ -1,20 +0,0 @@ -```javascript -import { Client, VectorsDB, Permission, Role } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.upsertDocument({ - databaseId: '', - collectionId: '', - documentId: '', - data: {}, // optional - permissions: [Permission.read(Role.any())], // optional - transactionId: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/vectorsdb/upsert-documents.md b/docs/examples/vectorsdb/upsert-documents.md deleted file mode 100644 index 74a03f92..00000000 --- a/docs/examples/vectorsdb/upsert-documents.md +++ /dev/null @@ -1,18 +0,0 @@ -```javascript -import { Client, VectorsDB } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const vectorsDB = new VectorsDB(client); - -const result = await vectorsDB.upsertDocuments({ - databaseId: '', - collectionId: '', - documents: [], - transactionId: '' // optional -}); - -console.log(result); -``` diff --git a/src/index.ts b/src/index.ts index 72466350..de9d3e79 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,7 +13,6 @@ export { Backups } from './services/backups'; export { Assistant } from './services/assistant'; export { Console } from './services/console'; export { Databases } from './services/databases'; -export { DocumentsDB } from './services/documents-db'; export { Domains } from './services/domains'; export { Functions } from './services/functions'; export { Graphql } from './services/graphql'; @@ -32,7 +31,6 @@ export { Teams } from './services/teams'; export { Tokens } from './services/tokens'; export { Users } from './services/users'; export { Vcs } from './services/vcs'; -export { VectorsDB } from './services/vectors-db'; export { Webhooks } from './services/webhooks'; export { Realtime } from './services/realtime'; export type { Models, Payload, RealtimeResponseEvent, UploadProgress } from './client'; diff --git a/src/services/documents-db.ts b/src/services/documents-db.ts deleted file mode 100644 index 158dee86..00000000 --- a/src/services/documents-db.ts +++ /dev/null @@ -1,2608 +0,0 @@ -import { Service } from '../service'; -import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; -import type { Models } from '../models'; - -import { UsageRange } from '../enums/usage-range'; -import { DocumentsDBIndexType } from '../enums/documents-db-index-type'; -import { OrderBy } from '../enums/order-by'; - -export class DocumentsDB { - client: Client; - - constructor(client: Client) { - this.client = client; - } - - /** - * 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; - /** - * 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; - list( - paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[], - ...rest: [(string)?, (boolean)?] - ): Promise { - let params: { queries?: string[], search?: string, total?: boolean }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean }; - } else { - params = { - queries: paramsOrFirst as string[], - search: rest[0] as string, - total: rest[1] as boolean - }; - } - - const queries = params.queries; - const search = params.search; - const total = params.total; - - - const apiPath = '/documentsdb'; - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof search !== 'undefined') { - payload['search'] = search; - } - if (typeof total !== 'undefined') { - payload['total'] = total; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * Create a new Database. - * - * - * @param {string} params.databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} params.name - Database name. Max length: 128 chars. - * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @throws {AppwriteException} - * @returns {Promise} - */ - create(params: { databaseId: string, name: string, enabled?: boolean }): Promise; - /** - * Create a new Database. - * - * - * @param {string} databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} name - Database name. Max length: 128 chars. - * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - create(databaseId: string, name: string, enabled?: boolean): Promise; - create( - paramsOrFirst: { databaseId: string, name: string, enabled?: boolean } | string, - ...rest: [(string)?, (boolean)?] - ): Promise { - let params: { databaseId: string, name: string, enabled?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean }; - } else { - params = { - databaseId: paramsOrFirst as string, - name: rest[0] as string, - enabled: rest[1] as boolean - }; - } - - const databaseId = params.databaseId; - const name = params.name; - const enabled = params.enabled; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - - const apiPath = '/documentsdb'; - const payload: Payload = {}; - if (typeof databaseId !== 'undefined') { - payload['databaseId'] = databaseId; - } - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof enabled !== 'undefined') { - payload['enabled'] = enabled; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @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). - * @throws {AppwriteException} - * @returns {Promise} - */ - listTransactions(params?: { queries?: string[] }): Promise; - /** - * - * @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). - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listTransactions(queries?: string[]): Promise; - listTransactions( - paramsOrFirst?: { queries?: string[] } | string[] - ): Promise { - let params: { queries?: string[] }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { queries?: string[] }; - } else { - params = { - queries: paramsOrFirst as string[] - }; - } - - const queries = params.queries; - - - const apiPath = '/documentsdb/transactions'; - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {number} params.ttl - Seconds before the transaction expires. - * @throws {AppwriteException} - * @returns {Promise} - */ - createTransaction(params?: { ttl?: number }): Promise; - /** - * - * @param {number} ttl - Seconds before the transaction expires. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - createTransaction(ttl?: number): Promise; - createTransaction( - paramsOrFirst?: { ttl?: number } | number - ): Promise { - let params: { ttl?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { ttl?: number }; - } else { - params = { - ttl: paramsOrFirst as number - }; - } - - const ttl = params.ttl; - - - const apiPath = '/documentsdb/transactions'; - const payload: Payload = {}; - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.transactionId - Transaction ID. - * @throws {AppwriteException} - * @returns {Promise} - */ - getTransaction(params: { transactionId: string }): Promise; - /** - * - * @param {string} transactionId - Transaction ID. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getTransaction(transactionId: string): Promise; - getTransaction( - paramsOrFirst: { transactionId: string } | string - ): Promise { - let params: { transactionId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { transactionId: string }; - } else { - params = { - transactionId: paramsOrFirst as string - }; - } - - const transactionId = params.transactionId; - - if (typeof transactionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "transactionId"'); - } - - const apiPath = '/documentsdb/transactions/{transactionId}'.replace('{transactionId}', transactionId); - 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 - ); - } - - /** - * - * @param {string} params.transactionId - Transaction ID. - * @param {boolean} params.commit - Commit transaction? - * @param {boolean} params.rollback - Rollback transaction? - * @throws {AppwriteException} - * @returns {Promise} - */ - updateTransaction(params: { transactionId: string, commit?: boolean, rollback?: boolean }): Promise; - /** - * - * @param {string} transactionId - Transaction ID. - * @param {boolean} commit - Commit transaction? - * @param {boolean} rollback - Rollback transaction? - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - updateTransaction(transactionId: string, commit?: boolean, rollback?: boolean): Promise; - updateTransaction( - paramsOrFirst: { transactionId: string, commit?: boolean, rollback?: boolean } | string, - ...rest: [(boolean)?, (boolean)?] - ): Promise { - let params: { transactionId: string, commit?: boolean, rollback?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { transactionId: string, commit?: boolean, rollback?: boolean }; - } else { - params = { - transactionId: paramsOrFirst as string, - commit: rest[0] as boolean, - rollback: rest[1] as boolean - }; - } - - const transactionId = params.transactionId; - const commit = params.commit; - const rollback = params.rollback; - - if (typeof transactionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "transactionId"'); - } - - const apiPath = '/documentsdb/transactions/{transactionId}'.replace('{transactionId}', transactionId); - const payload: Payload = {}; - if (typeof commit !== 'undefined') { - payload['commit'] = commit; - } - if (typeof rollback !== 'undefined') { - payload['rollback'] = rollback; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'patch', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.transactionId - Transaction ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - */ - deleteTransaction(params: { transactionId: string }): Promise<{}>; - /** - * - * @param {string} transactionId - Transaction ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - deleteTransaction(transactionId: string): Promise<{}>; - deleteTransaction( - paramsOrFirst: { transactionId: string } | string - ): Promise<{}> { - let params: { transactionId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { transactionId: string }; - } else { - params = { - transactionId: paramsOrFirst as string - }; - } - - const transactionId = params.transactionId; - - if (typeof transactionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "transactionId"'); - } - - const apiPath = '/documentsdb/transactions/{transactionId}'.replace('{transactionId}', transactionId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'delete', - uri, - apiHeaders, - payload - ); - } - - /** - * List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. - * - * @param {UsageRange} params.range - Date range. - * @throws {AppwriteException} - * @returns {Promise} - */ - listUsage(params?: { range?: UsageRange }): Promise; - /** - * List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. - * - * @param {UsageRange} range - Date range. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listUsage(range?: UsageRange): Promise; - listUsage( - paramsOrFirst?: { range?: UsageRange } | UsageRange - ): Promise { - let params: { range?: UsageRange }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { range?: UsageRange }; - } else { - params = { - range: paramsOrFirst as UsageRange - }; - } - - const range = params.range; - - - const apiPath = '/documentsdb/usage'; - const payload: Payload = {}; - if (typeof range !== 'undefined') { - payload['range'] = range; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. - * - * @param {string} params.databaseId - Database ID. - * @throws {AppwriteException} - * @returns {Promise} - */ - get(params: { databaseId: string }): Promise; - /** - * Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. - * - * @param {string} databaseId - Database ID. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - get(databaseId: string): Promise; - get( - paramsOrFirst: { databaseId: string } | string - ): Promise { - let params: { databaseId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string }; - } else { - params = { - databaseId: paramsOrFirst as string - }; - } - - const databaseId = params.databaseId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - - const apiPath = '/documentsdb/{databaseId}'.replace('{databaseId}', databaseId); - 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 - ); - } - - /** - * Update a database by its unique ID. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.name - Database name. Max length: 128 chars. - * @param {boolean} params.enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @throws {AppwriteException} - * @returns {Promise} - */ - update(params: { databaseId: string, name: string, enabled?: boolean }): Promise; - /** - * Update a database by its unique ID. - * - * @param {string} databaseId - Database ID. - * @param {string} name - Database name. Max length: 128 chars. - * @param {boolean} enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - update(databaseId: string, name: string, enabled?: boolean): Promise; - update( - paramsOrFirst: { databaseId: string, name: string, enabled?: boolean } | string, - ...rest: [(string)?, (boolean)?] - ): Promise { - let params: { databaseId: string, name: string, enabled?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean }; - } else { - params = { - databaseId: paramsOrFirst as string, - name: rest[0] as string, - enabled: rest[1] as boolean - }; - } - - const databaseId = params.databaseId; - const name = params.name; - const enabled = params.enabled; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - - const apiPath = '/documentsdb/{databaseId}'.replace('{databaseId}', databaseId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof enabled !== 'undefined') { - payload['enabled'] = enabled; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'put', - uri, - apiHeaders, - payload - ); - } - - /** - * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. - * - * @param {string} params.databaseId - Database ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - */ - delete(params: { databaseId: string }): Promise<{}>; - /** - * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. - * - * @param {string} databaseId - Database ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - delete(databaseId: string): Promise<{}>; - delete( - paramsOrFirst: { databaseId: string } | string - ): Promise<{}> { - let params: { databaseId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string }; - } else { - params = { - databaseId: paramsOrFirst as string - }; - } - - const databaseId = params.databaseId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - - const apiPath = '/documentsdb/{databaseId}'.replace('{databaseId}', databaseId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'delete', - uri, - apiHeaders, - payload - ); - } - - /** - * Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. - * - * @param {string} params.databaseId - Database ID. - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity - * @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} - */ - listCollections(params: { databaseId: string, queries?: string[], search?: string, total?: boolean }): Promise; - /** - * Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. - * - * @param {string} databaseId - Database ID. - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity - * @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. - */ - listCollections(databaseId: string, queries?: string[], search?: string, total?: boolean): Promise; - listCollections( - paramsOrFirst: { databaseId: string, queries?: string[], search?: string, total?: boolean } | string, - ...rest: [(string[])?, (string)?, (boolean)?] - ): Promise { - let params: { databaseId: string, queries?: string[], search?: string, total?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, queries?: string[], search?: string, total?: boolean }; - } else { - params = { - databaseId: paramsOrFirst as string, - queries: rest[0] as string[], - search: rest[1] as string, - total: rest[2] as boolean - }; - } - - const databaseId = params.databaseId; - const queries = params.queries; - const search = params.search; - const total = params.total; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections'.replace('{databaseId}', databaseId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof search !== 'undefined') { - payload['search'] = search; - } - if (typeof total !== 'undefined') { - payload['total'] = total; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} params.name - Collection name. Max length: 128 chars. - * @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. - * @param {object[]} params.attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. - * @param {object[]} params.indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). - * @throws {AppwriteException} - * @returns {Promise} - */ - createCollection(params: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[] }): Promise; - /** - * Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} name - Collection name. Max length: 128 chars. - * @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. - * @param {object[]} attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. - * @param {object[]} indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[]): Promise; - createCollection( - paramsOrFirst: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[] } | string, - ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (object[])?, (object[])?] - ): Promise { - let params: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[] }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - name: rest[1] as string, - permissions: rest[2] as string[], - documentSecurity: rest[3] as boolean, - enabled: rest[4] as boolean, - attributes: rest[5] as object[], - indexes: rest[6] as object[] - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const name = params.name; - const permissions = params.permissions; - const documentSecurity = params.documentSecurity; - const enabled = params.enabled; - const attributes = params.attributes; - const indexes = params.indexes; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections'.replace('{databaseId}', databaseId); - const payload: Payload = {}; - if (typeof collectionId !== 'undefined') { - payload['collectionId'] = collectionId; - } - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof permissions !== 'undefined') { - payload['permissions'] = permissions; - } - if (typeof documentSecurity !== 'undefined') { - payload['documentSecurity'] = documentSecurity; - } - if (typeof enabled !== 'undefined') { - payload['enabled'] = enabled; - } - if (typeof attributes !== 'undefined') { - payload['attributes'] = attributes; - } - if (typeof indexes !== 'undefined') { - payload['indexes'] = indexes; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload - ); - } - - /** - * Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @throws {AppwriteException} - * @returns {Promise} - */ - getCollection(params: { databaseId: string, collectionId: string }): Promise; - /** - * Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getCollection(databaseId: string, collectionId: string): Promise; - getCollection( - paramsOrFirst: { databaseId: string, collectionId: string } | string, - ...rest: [(string)?] - ): Promise { - let params: { databaseId: string, collectionId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - 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 - ); - } - - /** - * Update a collection by its unique ID. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {string} params.name - Collection name. Max length: 128 chars. - * @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. - * @throws {AppwriteException} - * @returns {Promise} - */ - updateCollection(params: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }): Promise; - /** - * Update a collection by its unique ID. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {string} name - Collection name. Max length: 128 chars. - * @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - updateCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise; - updateCollection( - paramsOrFirst: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?] - ): Promise { - let params: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - name: rest[1] as string, - permissions: rest[2] as string[], - documentSecurity: rest[3] as boolean, - enabled: rest[4] as boolean - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const name = params.name; - const permissions = params.permissions; - const documentSecurity = params.documentSecurity; - const enabled = params.enabled; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof permissions !== 'undefined') { - payload['permissions'] = permissions; - } - if (typeof documentSecurity !== 'undefined') { - payload['documentSecurity'] = documentSecurity; - } - if (typeof enabled !== 'undefined') { - payload['enabled'] = enabled; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'put', - uri, - apiHeaders, - payload - ); - } - - /** - * Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - */ - deleteCollection(params: { databaseId: string, collectionId: string }): Promise<{}>; - /** - * Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - deleteCollection(databaseId: string, collectionId: string): Promise<{}>; - deleteCollection( - paramsOrFirst: { databaseId: string, collectionId: string } | string, - ...rest: [(string)?] - ): Promise<{}> { - let params: { databaseId: string, collectionId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'delete', - uri, - apiHeaders, - payload - ); - } - - /** - * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @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. - * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. - * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). - * @throws {AppwriteException} - * @returns {Promise>} - */ - listDocuments(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }): Promise>; - /** - * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @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. - * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. - * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). - * @throws {AppwriteException} - * @returns {Promise>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listDocuments(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number): Promise>; - listDocuments( - paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number } | string, - ...rest: [(string)?, (string[])?, (string)?, (boolean)?, (number)?] - ): Promise> { - let params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - queries: rest[1] as string[], - transactionId: rest[2] as string, - total: rest[3] as boolean, - ttl: rest[4] as number - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const queries = params.queries; - const transactionId = params.transactionId; - const total = params.total; - const ttl = params.ttl; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - if (typeof total !== 'undefined') { - payload['total'] = total; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. - * @param {string} params.documentId - Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit} params.data - Document data as JSON object. - * @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @throws {AppwriteException} - * @returns {Promise} - */ - createDocument(params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[] }): Promise; - /** - * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. - * @param {string} documentId - Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit} data - Document data as JSON object. - * @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - createDocument(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[]): Promise; - createDocument( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[] } | string, - ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit)?, (string[])?] - ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[] }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documentId: rest[1] as string, - data: rest[2] as Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, - permissions: rest[3] as string[] - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documentId = params.documentId; - const data = params.data; - const permissions = params.permissions; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - if (typeof data === 'undefined') { - throw new AppwriteException('Missing required parameter: "data"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof documentId !== 'undefined') { - payload['documentId'] = documentId; - } - if (typeof data !== 'undefined') { - payload['data'] = data; - } - if (typeof permissions !== 'undefined') { - payload['permissions'] = permissions; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload - ); - } - - /** - * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. - * @param {object[]} params.documents - Array of documents data as JSON objects. - * @throws {AppwriteException} - * @returns {Promise>} - */ - createDocuments(params: { databaseId: string, collectionId: string, documents: object[] }): Promise>; - /** - * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. - * @param {object[]} documents - Array of documents data as JSON objects. - * @throws {AppwriteException} - * @returns {Promise>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - createDocuments(databaseId: string, collectionId: string, documents: object[]): Promise>; - createDocuments( - paramsOrFirst: { databaseId: string, collectionId: string, documents: object[] } | string, - ...rest: [(string)?, (object[])?] - ): Promise> { - let params: { databaseId: string, collectionId: string, documents: object[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documents: object[] }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documents: rest[1] as object[] - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documents = params.documents; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documents === 'undefined') { - throw new AppwriteException('Missing required parameter: "documents"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof documents !== 'undefined') { - payload['documents'] = documents; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload - ); - } - - /** - * Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {object[]} params.documents - Array of document data as JSON objects. May contain partial documents. - * @param {string} params.transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise>} - */ - upsertDocuments(params: { databaseId: string, collectionId: string, documents: object[], transactionId?: string }): Promise>; - /** - * Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {object[]} documents - Array of document data as JSON objects. May contain partial documents. - * @param {string} transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - upsertDocuments(databaseId: string, collectionId: string, documents: object[], transactionId?: string): Promise>; - upsertDocuments( - paramsOrFirst: { databaseId: string, collectionId: string, documents: object[], transactionId?: string } | string, - ...rest: [(string)?, (object[])?, (string)?] - ): Promise> { - let params: { databaseId: string, collectionId: string, documents: object[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documents: object[], transactionId?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documents: rest[1] as object[], - transactionId: rest[2] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documents = params.documents; - const transactionId = params.transactionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documents === 'undefined') { - throw new AppwriteException('Missing required parameter: "documents"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof documents !== 'undefined') { - payload['documents'] = documents; - } - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'put', - uri, - apiHeaders, - payload - ); - } - - /** - * Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {object} params.data - Document data as JSON object. Include only attribute and value pairs to be updated. - * @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. - * @param {string} params.transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise>} - */ - updateDocuments(params: { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string }): Promise>; - /** - * Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {object} data - Document data as JSON object. Include only attribute and value pairs to be updated. - * @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. - * @param {string} transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - updateDocuments(databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string): Promise>; - updateDocuments( - paramsOrFirst: { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string } | string, - ...rest: [(string)?, (object)?, (string[])?, (string)?] - ): Promise> { - let params: { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - data: rest[1] as object, - queries: rest[2] as string[], - transactionId: rest[3] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const data = params.data; - const queries = params.queries; - const transactionId = params.transactionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof data !== 'undefined') { - payload['data'] = data; - } - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'patch', - uri, - apiHeaders, - payload - ); - } - - /** - * Bulk delete documents using queries, if no queries are passed then all documents are deleted. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @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. - * @param {string} params.transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise>} - */ - deleteDocuments(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string }): Promise>; - /** - * Bulk delete documents using queries, if no queries are passed then all documents are deleted. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @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. - * @param {string} transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - deleteDocuments(databaseId: string, collectionId: string, queries?: string[], transactionId?: string): Promise>; - deleteDocuments( - paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string } | string, - ...rest: [(string)?, (string[])?, (string)?] - ): Promise> { - let params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], transactionId?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - queries: rest[1] as string[], - transactionId: rest[2] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const queries = params.queries; - const transactionId = params.transactionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'delete', - uri, - apiHeaders, - payload - ); - } - - /** - * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} params.documentId - Document ID. - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. - * @throws {AppwriteException} - * @returns {Promise} - */ - getDocument(params: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }): Promise; - /** - * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} documentId - Document ID. - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getDocument(databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string): Promise; - getDocument( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string[])?, (string)?] - ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documentId: rest[1] as string, - queries: rest[2] as string[], - transactionId: rest[3] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documentId = params.documentId; - const queries = params.queries; - const transactionId = params.transactionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {string} params.documentId - Document ID. - * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} params.data - Document data as JSON object. Include all required fields of the document to be created or updated. - * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} params.transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise} - */ - upsertDocument(params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }): Promise; - /** - * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {string} documentId - Document ID. - * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} data - Document data as JSON object. Include all required fields of the document to be created or updated. - * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - upsertDocument(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string): Promise; - upsertDocument( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string } | string, - ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>)?, (string[])?, (string)?] - ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documentId: rest[1] as string, - data: rest[2] as Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, - permissions: rest[3] as string[], - transactionId: rest[4] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documentId = params.documentId; - const data = params.data; - const permissions = params.permissions; - const transactionId = params.transactionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); - const payload: Payload = {}; - if (typeof data !== 'undefined') { - payload['data'] = data; - } - if (typeof permissions !== 'undefined') { - payload['permissions'] = permissions; - } - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'put', - uri, - apiHeaders, - payload - ); - } - - /** - * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {string} params.documentId - Document ID. - * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} params.data - Document data as JSON object. Include only fields and value pairs to be updated. - * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} params.transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise} - */ - updateDocument(params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }): Promise; - /** - * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {string} documentId - Document ID. - * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} data - Document data as JSON object. Include only fields and value pairs to be updated. - * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - updateDocument(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string): Promise; - updateDocument( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string } | string, - ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>)?, (string[])?, (string)?] - ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documentId: rest[1] as string, - data: rest[2] as Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, - permissions: rest[3] as string[], - transactionId: rest[4] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documentId = params.documentId; - const data = params.data; - const permissions = params.permissions; - const transactionId = params.transactionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); - const payload: Payload = {}; - if (typeof data !== 'undefined') { - payload['data'] = data; - } - if (typeof permissions !== 'undefined') { - payload['permissions'] = permissions; - } - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'patch', - uri, - apiHeaders, - payload - ); - } - - /** - * Delete a document by its unique ID. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} params.documentId - Document ID. - * @param {string} params.transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise<{}>} - */ - deleteDocument(params: { databaseId: string, collectionId: string, documentId: string, transactionId?: string }): Promise<{}>; - /** - * Delete a document by its unique ID. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} documentId - Document ID. - * @param {string} transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise<{}>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - deleteDocument(databaseId: string, collectionId: string, documentId: string, transactionId?: string): Promise<{}>; - deleteDocument( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?] - ): Promise<{}> { - let params: { databaseId: string, collectionId: string, documentId: string, transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, transactionId?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documentId: rest[1] as string, - transactionId: rest[2] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documentId = params.documentId; - const transactionId = params.transactionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); - const payload: Payload = {}; - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'delete', - uri, - apiHeaders, - payload - ); - } - - /** - * Get the document activity logs list by its unique ID. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {string} params.documentId - Document ID. - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset - * @throws {AppwriteException} - * @returns {Promise} - */ - listDocumentLogs(params: { databaseId: string, collectionId: string, documentId: string, queries?: string[] }): Promise; - /** - * Get the document activity logs list by its unique ID. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {string} documentId - Document ID. - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listDocumentLogs(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise; - listDocumentLogs( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, queries?: string[] } | string, - ...rest: [(string)?, (string)?, (string[])?] - ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, queries?: string[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, queries?: string[] }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documentId: rest[1] as string, - queries: rest[2] as string[] - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documentId = params.documentId; - const queries = params.queries; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * Decrement a specific column of a row by a given value. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {string} params.documentId - Document ID. - * @param {string} params.attribute - Attribute key. - * @param {number} params.value - Value to decrement the attribute by. The value must be a number. - * @param {number} params.min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. - * @param {string} params.transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise} - */ - decrementDocumentAttribute(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }): Promise; - /** - * Decrement a specific column of a row by a given value. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {string} documentId - Document ID. - * @param {string} attribute - Attribute key. - * @param {number} value - Value to decrement the attribute by. The value must be a number. - * @param {number} min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. - * @param {string} transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - decrementDocumentAttribute(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string): Promise; - decrementDocumentAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?] - ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documentId: rest[1] as string, - attribute: rest[2] as string, - value: rest[3] as number, - min: rest[4] as number, - transactionId: rest[5] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documentId = params.documentId; - const attribute = params.attribute; - const value = params.value; - const min = params.min; - const transactionId = params.transactionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - if (typeof attribute === 'undefined') { - throw new AppwriteException('Missing required parameter: "attribute"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute); - const payload: Payload = {}; - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof min !== 'undefined') { - payload['min'] = min; - } - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'patch', - uri, - apiHeaders, - payload - ); - } - - /** - * Increment a specific column of a row by a given value. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {string} params.documentId - Document ID. - * @param {string} params.attribute - Attribute key. - * @param {number} params.value - Value to increment the attribute by. The value must be a number. - * @param {number} params.max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. - * @param {string} params.transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise} - */ - incrementDocumentAttribute(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }): Promise; - /** - * Increment a specific column of a row by a given value. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {string} documentId - Document ID. - * @param {string} attribute - Attribute key. - * @param {number} value - Value to increment the attribute by. The value must be a number. - * @param {number} max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. - * @param {string} transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - incrementDocumentAttribute(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string): Promise; - incrementDocumentAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?] - ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documentId: rest[1] as string, - attribute: rest[2] as string, - value: rest[3] as number, - max: rest[4] as number, - transactionId: rest[5] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documentId = params.documentId; - const attribute = params.attribute; - const value = params.value; - const max = params.max; - const transactionId = params.transactionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - if (typeof attribute === 'undefined') { - throw new AppwriteException('Missing required parameter: "attribute"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute); - const payload: Payload = {}; - if (typeof value !== 'undefined') { - payload['value'] = value; - } - if (typeof max !== 'undefined') { - payload['max'] = max; - } - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'patch', - uri, - apiHeaders, - payload - ); - } - - /** - * List indexes in the collection. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error - * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - */ - listIndexes(params: { databaseId: string, collectionId: string, queries?: string[], total?: boolean }): Promise; - /** - * List indexes in the collection. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error - * @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. - */ - listIndexes(databaseId: string, collectionId: string, queries?: string[], total?: boolean): Promise; - listIndexes( - paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], total?: boolean } | string, - ...rest: [(string)?, (string[])?, (boolean)?] - ): Promise { - let params: { databaseId: string, collectionId: string, queries?: string[], total?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], total?: boolean }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - queries: rest[1] as string[], - total: rest[2] as boolean - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const queries = params.queries; - const total = params.total; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof total !== 'undefined') { - payload['total'] = total; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. - * Attributes can be `key`, `fulltext`, and `unique`. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} params.key - Index Key. - * @param {DocumentsDBIndexType} params.type - Index type. - * @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. - * @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed. - * @param {number[]} params.lengths - Length of index. Maximum of 100 - * @throws {AppwriteException} - * @returns {Promise} - */ - createIndex(params: { databaseId: string, collectionId: string, key: string, type: DocumentsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }): Promise; - /** - * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. - * Attributes can be `key`, `fulltext`, and `unique`. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} key - Index Key. - * @param {DocumentsDBIndexType} type - Index type. - * @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. - * @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed. - * @param {number[]} lengths - Length of index. Maximum of 100 - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - createIndex(databaseId: string, collectionId: string, key: string, type: DocumentsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[]): Promise; - createIndex( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, type: DocumentsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] } | string, - ...rest: [(string)?, (string)?, (DocumentsDBIndexType)?, (string[])?, (OrderBy[])?, (number[])?] - ): Promise { - let params: { databaseId: string, collectionId: string, key: string, type: DocumentsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, type: DocumentsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - key: rest[1] as string, - type: rest[2] as DocumentsDBIndexType, - attributes: rest[3] as string[], - orders: rest[4] as OrderBy[], - lengths: rest[5] as number[] - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const key = params.key; - const type = params.type; - const attributes = params.attributes; - const orders = params.orders; - const lengths = params.lengths; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof key === 'undefined') { - throw new AppwriteException('Missing required parameter: "key"'); - } - if (typeof type === 'undefined') { - throw new AppwriteException('Missing required parameter: "type"'); - } - if (typeof attributes === 'undefined') { - throw new AppwriteException('Missing required parameter: "attributes"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof key !== 'undefined') { - payload['key'] = key; - } - if (typeof type !== 'undefined') { - payload['type'] = type; - } - if (typeof attributes !== 'undefined') { - payload['attributes'] = attributes; - } - if (typeof orders !== 'undefined') { - payload['orders'] = orders; - } - if (typeof lengths !== 'undefined') { - payload['lengths'] = lengths; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload - ); - } - - /** - * Get index by ID. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} params.key - Index Key. - * @throws {AppwriteException} - * @returns {Promise} - */ - getIndex(params: { databaseId: string, collectionId: string, key: string }): Promise; - /** - * Get index by ID. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} key - Index Key. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getIndex(databaseId: string, collectionId: string, key: string): Promise; - getIndex( - paramsOrFirst: { databaseId: string, collectionId: string, key: string } | string, - ...rest: [(string)?, (string)?] - ): Promise { - let params: { databaseId: string, collectionId: string, key: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - key: rest[1] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const key = params.key; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof key === 'undefined') { - throw new AppwriteException('Missing required parameter: "key"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); - 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 - ); - } - - /** - * Delete an index. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} params.key - Index Key. - * @throws {AppwriteException} - * @returns {Promise<{}>} - */ - deleteIndex(params: { databaseId: string, collectionId: string, key: string }): Promise<{}>; - /** - * Delete an index. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} key - Index Key. - * @throws {AppwriteException} - * @returns {Promise<{}>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - deleteIndex(databaseId: string, collectionId: string, key: string): Promise<{}>; - deleteIndex( - paramsOrFirst: { databaseId: string, collectionId: string, key: string } | string, - ...rest: [(string)?, (string)?] - ): Promise<{}> { - let params: { databaseId: string, collectionId: string, key: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - key: rest[1] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const key = params.key; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof key === 'undefined') { - throw new AppwriteException('Missing required parameter: "key"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'delete', - uri, - apiHeaders, - payload - ); - } - - /** - * Get the collection activity logs list by its unique ID. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset - * @throws {AppwriteException} - * @returns {Promise} - */ - listCollectionLogs(params: { databaseId: string, collectionId: string, queries?: string[] }): Promise; - /** - * Get the collection activity logs list by its unique ID. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listCollectionLogs(databaseId: string, collectionId: string, queries?: string[]): Promise; - listCollectionLogs( - paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[] } | string, - ...rest: [(string)?, (string[])?] - ): Promise { - let params: { databaseId: string, collectionId: string, queries?: string[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[] }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - queries: rest[1] as string[] - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const queries = params.queries; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {UsageRange} params.range - Date range. - * @throws {AppwriteException} - * @returns {Promise} - */ - getCollectionUsage(params: { databaseId: string, collectionId: string, range?: UsageRange }): Promise; - /** - * Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {UsageRange} range - Date range. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getCollectionUsage(databaseId: string, collectionId: string, range?: UsageRange): Promise; - getCollectionUsage( - paramsOrFirst: { databaseId: string, collectionId: string, range?: UsageRange } | string, - ...rest: [(string)?, (UsageRange)?] - ): Promise { - let params: { databaseId: string, collectionId: string, range?: UsageRange }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, range?: UsageRange }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - range: rest[1] as UsageRange - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const range = params.range; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/documentsdb/{databaseId}/collections/{collectionId}/usage'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof range !== 'undefined') { - payload['range'] = range; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. - * - * @param {string} params.databaseId - Database ID. - * @param {UsageRange} params.range - Date range. - * @throws {AppwriteException} - * @returns {Promise} - */ - getUsage(params: { databaseId: string, range?: UsageRange }): Promise; - /** - * Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. - * - * @param {string} databaseId - Database ID. - * @param {UsageRange} range - Date range. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getUsage(databaseId: string, range?: UsageRange): Promise; - getUsage( - paramsOrFirst: { databaseId: string, range?: UsageRange } | string, - ...rest: [(UsageRange)?] - ): Promise { - let params: { databaseId: string, range?: UsageRange }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, range?: UsageRange }; - } else { - params = { - databaseId: paramsOrFirst as string, - range: rest[0] as UsageRange - }; - } - - const databaseId = params.databaseId; - const range = params.range; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - - const apiPath = '/documentsdb/{databaseId}/usage'.replace('{databaseId}', databaseId); - const payload: Payload = {}; - if (typeof range !== 'undefined') { - payload['range'] = range; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } -} diff --git a/src/services/vectors-db.ts b/src/services/vectors-db.ts deleted file mode 100644 index fa422e08..00000000 --- a/src/services/vectors-db.ts +++ /dev/null @@ -1,2477 +0,0 @@ -import { Service } from '../service'; -import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; -import type { Models } from '../models'; - -import { Model } from '../enums/model'; -import { UsageRange } from '../enums/usage-range'; -import { VectorsDBIndexType } from '../enums/vectors-db-index-type'; -import { OrderBy } from '../enums/order-by'; - -export class VectorsDB { - client: Client; - - constructor(client: Client) { - this.client = client; - } - - /** - * - * @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; - /** - * - * @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; - list( - paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[], - ...rest: [(string)?, (boolean)?] - ): Promise { - let params: { queries?: string[], search?: string, total?: boolean }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean }; - } else { - params = { - queries: paramsOrFirst as string[], - search: rest[0] as string, - total: rest[1] as boolean - }; - } - - const queries = params.queries; - const search = params.search; - const total = params.total; - - - const apiPath = '/vectorsdb'; - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof search !== 'undefined') { - payload['search'] = search; - } - if (typeof total !== 'undefined') { - payload['total'] = total; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} params.name - Database name. Max length: 128 chars. - * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @throws {AppwriteException} - * @returns {Promise} - */ - create(params: { databaseId: string, name: string, enabled?: boolean }): Promise; - /** - * - * @param {string} databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} name - Database name. Max length: 128 chars. - * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - create(databaseId: string, name: string, enabled?: boolean): Promise; - create( - paramsOrFirst: { databaseId: string, name: string, enabled?: boolean } | string, - ...rest: [(string)?, (boolean)?] - ): Promise { - let params: { databaseId: string, name: string, enabled?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean }; - } else { - params = { - databaseId: paramsOrFirst as string, - name: rest[0] as string, - enabled: rest[1] as boolean - }; - } - - const databaseId = params.databaseId; - const name = params.name; - const enabled = params.enabled; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - - const apiPath = '/vectorsdb'; - const payload: Payload = {}; - if (typeof databaseId !== 'undefined') { - payload['databaseId'] = databaseId; - } - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof enabled !== 'undefined') { - payload['enabled'] = enabled; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string[]} params.texts - Array of text to generate embeddings. - * @param {Model} params.model - The embedding model to use for generating vector embeddings. - * @throws {AppwriteException} - * @returns {Promise} - */ - createTextEmbeddings(params: { texts: string[], model?: Model }): Promise; - /** - * - * @param {string[]} texts - Array of text to generate embeddings. - * @param {Model} model - The embedding model to use for generating vector embeddings. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - createTextEmbeddings(texts: string[], model?: Model): Promise; - createTextEmbeddings( - paramsOrFirst: { texts: string[], model?: Model } | string[], - ...rest: [(Model)?] - ): Promise { - let params: { texts: string[], model?: Model }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { texts: string[], model?: Model }; - } else { - params = { - texts: paramsOrFirst as string[], - model: rest[0] as Model - }; - } - - const texts = params.texts; - const model = params.model; - - if (typeof texts === 'undefined') { - throw new AppwriteException('Missing required parameter: "texts"'); - } - - const apiPath = '/vectorsdb/embeddings/text'; - const payload: Payload = {}; - if (typeof texts !== 'undefined') { - payload['texts'] = texts; - } - if (typeof model !== 'undefined') { - payload['model'] = model; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @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). - * @throws {AppwriteException} - * @returns {Promise} - */ - listTransactions(params?: { queries?: string[] }): Promise; - /** - * - * @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). - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listTransactions(queries?: string[]): Promise; - listTransactions( - paramsOrFirst?: { queries?: string[] } | string[] - ): Promise { - let params: { queries?: string[] }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { queries?: string[] }; - } else { - params = { - queries: paramsOrFirst as string[] - }; - } - - const queries = params.queries; - - - const apiPath = '/vectorsdb/transactions'; - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {number} params.ttl - Seconds before the transaction expires. - * @throws {AppwriteException} - * @returns {Promise} - */ - createTransaction(params?: { ttl?: number }): Promise; - /** - * - * @param {number} ttl - Seconds before the transaction expires. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - createTransaction(ttl?: number): Promise; - createTransaction( - paramsOrFirst?: { ttl?: number } | number - ): Promise { - let params: { ttl?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { ttl?: number }; - } else { - params = { - ttl: paramsOrFirst as number - }; - } - - const ttl = params.ttl; - - - const apiPath = '/vectorsdb/transactions'; - const payload: Payload = {}; - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.transactionId - Transaction ID. - * @throws {AppwriteException} - * @returns {Promise} - */ - getTransaction(params: { transactionId: string }): Promise; - /** - * - * @param {string} transactionId - Transaction ID. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getTransaction(transactionId: string): Promise; - getTransaction( - paramsOrFirst: { transactionId: string } | string - ): Promise { - let params: { transactionId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { transactionId: string }; - } else { - params = { - transactionId: paramsOrFirst as string - }; - } - - const transactionId = params.transactionId; - - if (typeof transactionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "transactionId"'); - } - - const apiPath = '/vectorsdb/transactions/{transactionId}'.replace('{transactionId}', transactionId); - 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 - ); - } - - /** - * - * @param {string} params.transactionId - Transaction ID. - * @param {boolean} params.commit - Commit transaction? - * @param {boolean} params.rollback - Rollback transaction? - * @throws {AppwriteException} - * @returns {Promise} - */ - updateTransaction(params: { transactionId: string, commit?: boolean, rollback?: boolean }): Promise; - /** - * - * @param {string} transactionId - Transaction ID. - * @param {boolean} commit - Commit transaction? - * @param {boolean} rollback - Rollback transaction? - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - updateTransaction(transactionId: string, commit?: boolean, rollback?: boolean): Promise; - updateTransaction( - paramsOrFirst: { transactionId: string, commit?: boolean, rollback?: boolean } | string, - ...rest: [(boolean)?, (boolean)?] - ): Promise { - let params: { transactionId: string, commit?: boolean, rollback?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { transactionId: string, commit?: boolean, rollback?: boolean }; - } else { - params = { - transactionId: paramsOrFirst as string, - commit: rest[0] as boolean, - rollback: rest[1] as boolean - }; - } - - const transactionId = params.transactionId; - const commit = params.commit; - const rollback = params.rollback; - - if (typeof transactionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "transactionId"'); - } - - const apiPath = '/vectorsdb/transactions/{transactionId}'.replace('{transactionId}', transactionId); - const payload: Payload = {}; - if (typeof commit !== 'undefined') { - payload['commit'] = commit; - } - if (typeof rollback !== 'undefined') { - payload['rollback'] = rollback; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'patch', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.transactionId - Transaction ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - */ - deleteTransaction(params: { transactionId: string }): Promise<{}>; - /** - * - * @param {string} transactionId - Transaction ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - deleteTransaction(transactionId: string): Promise<{}>; - deleteTransaction( - paramsOrFirst: { transactionId: string } | string - ): Promise<{}> { - let params: { transactionId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { transactionId: string }; - } else { - params = { - transactionId: paramsOrFirst as string - }; - } - - const transactionId = params.transactionId; - - if (typeof transactionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "transactionId"'); - } - - const apiPath = '/vectorsdb/transactions/{transactionId}'.replace('{transactionId}', transactionId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'delete', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.transactionId - Transaction ID. - * @param {object[]} params.operations - Array of staged operations. - * @throws {AppwriteException} - * @returns {Promise} - */ - createOperations(params: { transactionId: string, operations?: object[] }): Promise; - /** - * - * @param {string} transactionId - Transaction ID. - * @param {object[]} operations - Array of staged operations. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - createOperations(transactionId: string, operations?: object[]): Promise; - createOperations( - paramsOrFirst: { transactionId: string, operations?: object[] } | string, - ...rest: [(object[])?] - ): Promise { - let params: { transactionId: string, operations?: object[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { transactionId: string, operations?: object[] }; - } else { - params = { - transactionId: paramsOrFirst as string, - operations: rest[0] as object[] - }; - } - - const transactionId = params.transactionId; - const operations = params.operations; - - if (typeof transactionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "transactionId"'); - } - - const apiPath = '/vectorsdb/transactions/{transactionId}/operations'.replace('{transactionId}', transactionId); - const payload: Payload = {}; - if (typeof operations !== 'undefined') { - payload['operations'] = operations; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {UsageRange} params.range - Date range. - * @throws {AppwriteException} - * @returns {Promise} - */ - listUsage(params?: { range?: UsageRange }): Promise; - /** - * - * @param {UsageRange} range - Date range. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listUsage(range?: UsageRange): Promise; - listUsage( - paramsOrFirst?: { range?: UsageRange } | UsageRange - ): Promise { - let params: { range?: UsageRange }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { range?: UsageRange }; - } else { - params = { - range: paramsOrFirst as UsageRange - }; - } - - const range = params.range; - - - const apiPath = '/vectorsdb/usage'; - const payload: Payload = {}; - if (typeof range !== 'undefined') { - payload['range'] = range; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @throws {AppwriteException} - * @returns {Promise} - */ - get(params: { databaseId: string }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - get(databaseId: string): Promise; - get( - paramsOrFirst: { databaseId: string } | string - ): Promise { - let params: { databaseId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string }; - } else { - params = { - databaseId: paramsOrFirst as string - }; - } - - const databaseId = params.databaseId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - - const apiPath = '/vectorsdb/{databaseId}'.replace('{databaseId}', databaseId); - 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 - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.name - Database name. Max length: 128 chars. - * @param {boolean} params.enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @throws {AppwriteException} - * @returns {Promise} - */ - update(params: { databaseId: string, name: string, enabled?: boolean }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} name - Database name. Max length: 128 chars. - * @param {boolean} enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - update(databaseId: string, name: string, enabled?: boolean): Promise; - update( - paramsOrFirst: { databaseId: string, name: string, enabled?: boolean } | string, - ...rest: [(string)?, (boolean)?] - ): Promise { - let params: { databaseId: string, name: string, enabled?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean }; - } else { - params = { - databaseId: paramsOrFirst as string, - name: rest[0] as string, - enabled: rest[1] as boolean - }; - } - - const databaseId = params.databaseId; - const name = params.name; - const enabled = params.enabled; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - - const apiPath = '/vectorsdb/{databaseId}'.replace('{databaseId}', databaseId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof enabled !== 'undefined') { - payload['enabled'] = enabled; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'put', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - */ - delete(params: { databaseId: string }): Promise<{}>; - /** - * - * @param {string} databaseId - Database ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - delete(databaseId: string): Promise<{}>; - delete( - paramsOrFirst: { databaseId: string } | string - ): Promise<{}> { - let params: { databaseId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string }; - } else { - params = { - databaseId: paramsOrFirst as string - }; - } - - const databaseId = params.databaseId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - - const apiPath = '/vectorsdb/{databaseId}'.replace('{databaseId}', databaseId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'delete', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity - * @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} - */ - listCollections(params: { databaseId: string, queries?: string[], search?: string, total?: boolean }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity - * @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. - */ - listCollections(databaseId: string, queries?: string[], search?: string, total?: boolean): Promise; - listCollections( - paramsOrFirst: { databaseId: string, queries?: string[], search?: string, total?: boolean } | string, - ...rest: [(string[])?, (string)?, (boolean)?] - ): Promise { - let params: { databaseId: string, queries?: string[], search?: string, total?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, queries?: string[], search?: string, total?: boolean }; - } else { - params = { - databaseId: paramsOrFirst as string, - queries: rest[0] as string[], - search: rest[1] as string, - total: rest[2] as boolean - }; - } - - const databaseId = params.databaseId; - const queries = params.queries; - const search = params.search; - const total = params.total; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections'.replace('{databaseId}', databaseId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof search !== 'undefined') { - payload['search'] = search; - } - if (typeof total !== 'undefined') { - payload['total'] = total; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} params.name - Collection name. Max length: 128 chars. - * @param {number} params.dimension - Embedding dimension. - * @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. - * @throws {AppwriteException} - * @returns {Promise} - */ - createCollection(params: { databaseId: string, collectionId: string, name: string, dimension: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} name - Collection name. Max length: 128 chars. - * @param {number} dimension - Embedding dimension. - * @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - createCollection(databaseId: string, collectionId: string, name: string, dimension: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise; - createCollection( - paramsOrFirst: { databaseId: string, collectionId: string, name: string, dimension: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (number)?, (string[])?, (boolean)?, (boolean)?] - ): Promise { - let params: { databaseId: string, collectionId: string, name: string, dimension: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, name: string, dimension: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - name: rest[1] as string, - dimension: rest[2] as number, - permissions: rest[3] as string[], - documentSecurity: rest[4] as boolean, - enabled: rest[5] as boolean - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const name = params.name; - const dimension = params.dimension; - const permissions = params.permissions; - const documentSecurity = params.documentSecurity; - const enabled = params.enabled; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - if (typeof dimension === 'undefined') { - throw new AppwriteException('Missing required parameter: "dimension"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections'.replace('{databaseId}', databaseId); - const payload: Payload = {}; - if (typeof collectionId !== 'undefined') { - payload['collectionId'] = collectionId; - } - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof dimension !== 'undefined') { - payload['dimension'] = dimension; - } - if (typeof permissions !== 'undefined') { - payload['permissions'] = permissions; - } - if (typeof documentSecurity !== 'undefined') { - payload['documentSecurity'] = documentSecurity; - } - if (typeof enabled !== 'undefined') { - payload['enabled'] = enabled; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @throws {AppwriteException} - * @returns {Promise} - */ - getCollection(params: { databaseId: string, collectionId: string }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getCollection(databaseId: string, collectionId: string): Promise; - getCollection( - paramsOrFirst: { databaseId: string, collectionId: string } | string, - ...rest: [(string)?] - ): Promise { - let params: { databaseId: string, collectionId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - 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 - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {string} params.name - Collection name. Max length: 128 chars. - * @param {number} params.dimension - Embedding dimensions. - * @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. - * @throws {AppwriteException} - * @returns {Promise} - */ - updateCollection(params: { databaseId: string, collectionId: string, name: string, dimension?: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {string} name - Collection name. Max length: 128 chars. - * @param {number} dimension - Embedding dimensions. - * @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - updateCollection(databaseId: string, collectionId: string, name: string, dimension?: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise; - updateCollection( - paramsOrFirst: { databaseId: string, collectionId: string, name: string, dimension?: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (number)?, (string[])?, (boolean)?, (boolean)?] - ): Promise { - let params: { databaseId: string, collectionId: string, name: string, dimension?: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, name: string, dimension?: number, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - name: rest[1] as string, - dimension: rest[2] as number, - permissions: rest[3] as string[], - documentSecurity: rest[4] as boolean, - enabled: rest[5] as boolean - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const name = params.name; - const dimension = params.dimension; - const permissions = params.permissions; - const documentSecurity = params.documentSecurity; - const enabled = params.enabled; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof dimension !== 'undefined') { - payload['dimension'] = dimension; - } - if (typeof permissions !== 'undefined') { - payload['permissions'] = permissions; - } - if (typeof documentSecurity !== 'undefined') { - payload['documentSecurity'] = documentSecurity; - } - if (typeof enabled !== 'undefined') { - payload['enabled'] = enabled; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'put', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - */ - deleteCollection(params: { databaseId: string, collectionId: string }): Promise<{}>; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - deleteCollection(databaseId: string, collectionId: string): Promise<{}>; - deleteCollection( - paramsOrFirst: { databaseId: string, collectionId: string } | string, - ...rest: [(string)?] - ): Promise<{}> { - let params: { databaseId: string, collectionId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'delete', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @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. - * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. - * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). - * @throws {AppwriteException} - * @returns {Promise>} - */ - listDocuments(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }): Promise>; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @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. - * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. - * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). - * @throws {AppwriteException} - * @returns {Promise>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listDocuments(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number): Promise>; - listDocuments( - paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number } | string, - ...rest: [(string)?, (string[])?, (string)?, (boolean)?, (number)?] - ): Promise> { - let params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - queries: rest[1] as string[], - transactionId: rest[2] as string, - total: rest[3] as boolean, - ttl: rest[4] as number - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const queries = params.queries; - const transactionId = params.transactionId; - const total = params.total; - const ttl = params.ttl; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - if (typeof total !== 'undefined') { - payload['total'] = total; - } - if (typeof ttl !== 'undefined') { - payload['ttl'] = ttl; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. - * @param {string} params.documentId - Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit} params.data - Document data as JSON object. - * @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @throws {AppwriteException} - * @returns {Promise} - */ - createDocument(params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[] }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. - * @param {string} documentId - Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit} data - Document data as JSON object. - * @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - createDocument(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[]): Promise; - createDocument( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[] } | string, - ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit)?, (string[])?] - ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[] }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documentId: rest[1] as string, - data: rest[2] as Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, - permissions: rest[3] as string[] - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documentId = params.documentId; - const data = params.data; - const permissions = params.permissions; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - if (typeof data === 'undefined') { - throw new AppwriteException('Missing required parameter: "data"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof documentId !== 'undefined') { - payload['documentId'] = documentId; - } - if (typeof data !== 'undefined') { - payload['data'] = data; - } - if (typeof permissions !== 'undefined') { - payload['permissions'] = permissions; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. - * @param {object[]} params.documents - Array of documents data as JSON objects. - * @throws {AppwriteException} - * @returns {Promise>} - */ - createDocuments(params: { databaseId: string, collectionId: string, documents: object[] }): Promise>; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. - * @param {object[]} documents - Array of documents data as JSON objects. - * @throws {AppwriteException} - * @returns {Promise>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - createDocuments(databaseId: string, collectionId: string, documents: object[]): Promise>; - createDocuments( - paramsOrFirst: { databaseId: string, collectionId: string, documents: object[] } | string, - ...rest: [(string)?, (object[])?] - ): Promise> { - let params: { databaseId: string, collectionId: string, documents: object[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documents: object[] }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documents: rest[1] as object[] - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documents = params.documents; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documents === 'undefined') { - throw new AppwriteException('Missing required parameter: "documents"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof documents !== 'undefined') { - payload['documents'] = documents; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {object[]} params.documents - Array of document data as JSON objects. May contain partial documents. - * @param {string} params.transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise>} - */ - upsertDocuments(params: { databaseId: string, collectionId: string, documents: object[], transactionId?: string }): Promise>; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {object[]} documents - Array of document data as JSON objects. May contain partial documents. - * @param {string} transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - upsertDocuments(databaseId: string, collectionId: string, documents: object[], transactionId?: string): Promise>; - upsertDocuments( - paramsOrFirst: { databaseId: string, collectionId: string, documents: object[], transactionId?: string } | string, - ...rest: [(string)?, (object[])?, (string)?] - ): Promise> { - let params: { databaseId: string, collectionId: string, documents: object[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documents: object[], transactionId?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documents: rest[1] as object[], - transactionId: rest[2] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documents = params.documents; - const transactionId = params.transactionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documents === 'undefined') { - throw new AppwriteException('Missing required parameter: "documents"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof documents !== 'undefined') { - payload['documents'] = documents; - } - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'put', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {object} params.data - Document data as JSON object. Include only attribute and value pairs to be updated. - * @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. - * @param {string} params.transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise>} - */ - updateDocuments(params: { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string }): Promise>; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {object} data - Document data as JSON object. Include only attribute and value pairs to be updated. - * @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. - * @param {string} transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - updateDocuments(databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string): Promise>; - updateDocuments( - paramsOrFirst: { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string } | string, - ...rest: [(string)?, (object)?, (string[])?, (string)?] - ): Promise> { - let params: { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, data?: object, queries?: string[], transactionId?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - data: rest[1] as object, - queries: rest[2] as string[], - transactionId: rest[3] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const data = params.data; - const queries = params.queries; - const transactionId = params.transactionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof data !== 'undefined') { - payload['data'] = data; - } - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'patch', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @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. - * @param {string} params.transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise>} - */ - deleteDocuments(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string }): Promise>; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @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. - * @param {string} transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - deleteDocuments(databaseId: string, collectionId: string, queries?: string[], transactionId?: string): Promise>; - deleteDocuments( - paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string } | string, - ...rest: [(string)?, (string[])?, (string)?] - ): Promise> { - let params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], transactionId?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - queries: rest[1] as string[], - transactionId: rest[2] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const queries = params.queries; - const transactionId = params.transactionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'delete', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} params.documentId - Document ID. - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. - * @throws {AppwriteException} - * @returns {Promise} - */ - getDocument(params: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} documentId - Document ID. - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getDocument(databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string): Promise; - getDocument( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string[])?, (string)?] - ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documentId: rest[1] as string, - queries: rest[2] as string[], - transactionId: rest[3] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documentId = params.documentId; - const queries = params.queries; - const transactionId = params.transactionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {string} params.documentId - Document ID. - * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} params.data - Document data as JSON object. Include all required fields of the document to be created or updated. - * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} params.transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise} - */ - upsertDocument(params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {string} documentId - Document ID. - * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} data - Document data as JSON object. Include all required fields of the document to be created or updated. - * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - upsertDocument(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string): Promise; - upsertDocument( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string } | string, - ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>)?, (string[])?, (string)?] - ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documentId: rest[1] as string, - data: rest[2] as Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, - permissions: rest[3] as string[], - transactionId: rest[4] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documentId = params.documentId; - const data = params.data; - const permissions = params.permissions; - const transactionId = params.transactionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); - const payload: Payload = {}; - if (typeof data !== 'undefined') { - payload['data'] = data; - } - if (typeof permissions !== 'undefined') { - payload['permissions'] = permissions; - } - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'put', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {string} params.documentId - Document ID. - * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} params.data - Document data as JSON object. Include only fields and value pairs to be updated. - * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} params.transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise} - */ - updateDocument(params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {string} documentId - Document ID. - * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} data - Document data as JSON object. Include only fields and value pairs to be updated. - * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). - * @param {string} transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - updateDocument(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string): Promise; - updateDocument( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string } | string, - ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>)?, (string[])?, (string)?] - ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documentId: rest[1] as string, - data: rest[2] as Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, - permissions: rest[3] as string[], - transactionId: rest[4] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documentId = params.documentId; - const data = params.data; - const permissions = params.permissions; - const transactionId = params.transactionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); - const payload: Payload = {}; - if (typeof data !== 'undefined') { - payload['data'] = data; - } - if (typeof permissions !== 'undefined') { - payload['permissions'] = permissions; - } - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'patch', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} params.documentId - Document ID. - * @param {string} params.transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise<{}>} - */ - deleteDocument(params: { databaseId: string, collectionId: string, documentId: string, transactionId?: string }): Promise<{}>; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} documentId - Document ID. - * @param {string} transactionId - Transaction ID for staging the operation. - * @throws {AppwriteException} - * @returns {Promise<{}>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - deleteDocument(databaseId: string, collectionId: string, documentId: string, transactionId?: string): Promise<{}>; - deleteDocument( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?] - ): Promise<{}> { - let params: { databaseId: string, collectionId: string, documentId: string, transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, transactionId?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documentId: rest[1] as string, - transactionId: rest[2] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documentId = params.documentId; - const transactionId = params.transactionId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); - const payload: Payload = {}; - if (typeof transactionId !== 'undefined') { - payload['transactionId'] = transactionId; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'delete', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {string} params.documentId - Document ID. - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset - * @throws {AppwriteException} - * @returns {Promise} - */ - listDocumentLogs(params: { databaseId: string, collectionId: string, documentId: string, queries?: string[] }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {string} documentId - Document ID. - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listDocumentLogs(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise; - listDocumentLogs( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, queries?: string[] } | string, - ...rest: [(string)?, (string)?, (string[])?] - ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, queries?: string[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, queries?: string[] }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - documentId: rest[1] as string, - queries: rest[2] as string[] - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const documentId = params.documentId; - const queries = params.queries; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/documents/{documentId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error - * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - */ - listIndexes(params: { databaseId: string, collectionId: string, queries?: string[], total?: boolean }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error - * @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. - */ - listIndexes(databaseId: string, collectionId: string, queries?: string[], total?: boolean): Promise; - listIndexes( - paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], total?: boolean } | string, - ...rest: [(string)?, (string[])?, (boolean)?] - ): Promise { - let params: { databaseId: string, collectionId: string, queries?: string[], total?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], total?: boolean }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - queries: rest[1] as string[], - total: rest[2] as boolean - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const queries = params.queries; - const total = params.total; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof total !== 'undefined') { - payload['total'] = total; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} params.key - Index Key. - * @param {VectorsDBIndexType} params.type - Index type. - * @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. - * @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed. - * @param {number[]} params.lengths - Length of index. Maximum of 100 - * @throws {AppwriteException} - * @returns {Promise} - */ - createIndex(params: { databaseId: string, collectionId: string, key: string, type: VectorsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} key - Index Key. - * @param {VectorsDBIndexType} type - Index type. - * @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long. - * @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed. - * @param {number[]} lengths - Length of index. Maximum of 100 - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - createIndex(databaseId: string, collectionId: string, key: string, type: VectorsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[]): Promise; - createIndex( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, type: VectorsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] } | string, - ...rest: [(string)?, (string)?, (VectorsDBIndexType)?, (string[])?, (OrderBy[])?, (number[])?] - ): Promise { - let params: { databaseId: string, collectionId: string, key: string, type: VectorsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, type: VectorsDBIndexType, attributes: string[], orders?: OrderBy[], lengths?: number[] }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - key: rest[1] as string, - type: rest[2] as VectorsDBIndexType, - attributes: rest[3] as string[], - orders: rest[4] as OrderBy[], - lengths: rest[5] as number[] - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const key = params.key; - const type = params.type; - const attributes = params.attributes; - const orders = params.orders; - const lengths = params.lengths; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof key === 'undefined') { - throw new AppwriteException('Missing required parameter: "key"'); - } - if (typeof type === 'undefined') { - throw new AppwriteException('Missing required parameter: "type"'); - } - if (typeof attributes === 'undefined') { - throw new AppwriteException('Missing required parameter: "attributes"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof key !== 'undefined') { - payload['key'] = key; - } - if (typeof type !== 'undefined') { - payload['type'] = type; - } - if (typeof attributes !== 'undefined') { - payload['attributes'] = attributes; - } - if (typeof orders !== 'undefined') { - payload['orders'] = orders; - } - if (typeof lengths !== 'undefined') { - payload['lengths'] = lengths; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} params.key - Index Key. - * @throws {AppwriteException} - * @returns {Promise} - */ - getIndex(params: { databaseId: string, collectionId: string, key: string }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} key - Index Key. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getIndex(databaseId: string, collectionId: string, key: string): Promise; - getIndex( - paramsOrFirst: { databaseId: string, collectionId: string, key: string } | string, - ...rest: [(string)?, (string)?] - ): Promise { - let params: { databaseId: string, collectionId: string, key: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - key: rest[1] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const key = params.key; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof key === 'undefined') { - throw new AppwriteException('Missing required parameter: "key"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); - 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 - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} params.key - Index Key. - * @throws {AppwriteException} - * @returns {Promise<{}>} - */ - deleteIndex(params: { databaseId: string, collectionId: string, key: string }): Promise<{}>; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @param {string} key - Index Key. - * @throws {AppwriteException} - * @returns {Promise<{}>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - deleteIndex(databaseId: string, collectionId: string, key: string): Promise<{}>; - deleteIndex( - paramsOrFirst: { databaseId: string, collectionId: string, key: string } | string, - ...rest: [(string)?, (string)?] - ): Promise<{}> { - let params: { databaseId: string, collectionId: string, key: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - key: rest[1] as string - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const key = params.key; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - if (typeof key === 'undefined') { - throw new AppwriteException('Missing required parameter: "key"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', - } - - return this.client.call( - 'delete', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset - * @throws {AppwriteException} - * @returns {Promise} - */ - listCollectionLogs(params: { databaseId: string, collectionId: string, queries?: string[] }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listCollectionLogs(databaseId: string, collectionId: string, queries?: string[]): Promise; - listCollectionLogs( - paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[] } | string, - ...rest: [(string)?, (string[])?] - ): Promise { - let params: { databaseId: string, collectionId: string, queries?: string[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[] }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - queries: rest[1] as string[] - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const queries = params.queries; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.collectionId - Collection ID. - * @param {UsageRange} params.range - Date range. - * @throws {AppwriteException} - * @returns {Promise} - */ - getCollectionUsage(params: { databaseId: string, collectionId: string, range?: UsageRange }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @param {string} collectionId - Collection ID. - * @param {UsageRange} range - Date range. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getCollectionUsage(databaseId: string, collectionId: string, range?: UsageRange): Promise; - getCollectionUsage( - paramsOrFirst: { databaseId: string, collectionId: string, range?: UsageRange } | string, - ...rest: [(string)?, (UsageRange)?] - ): Promise { - let params: { databaseId: string, collectionId: string, range?: UsageRange }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, range?: UsageRange }; - } else { - params = { - databaseId: paramsOrFirst as string, - collectionId: rest[0] as string, - range: rest[1] as UsageRange - }; - } - - const databaseId = params.databaseId; - const collectionId = params.collectionId; - const range = params.range; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/vectorsdb/{databaseId}/collections/{collectionId}/usage'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); - const payload: Payload = {}; - if (typeof range !== 'undefined') { - payload['range'] = range; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * - * @param {string} params.databaseId - Database ID. - * @param {UsageRange} params.range - Date range. - * @throws {AppwriteException} - * @returns {Promise} - */ - getUsage(params: { databaseId: string, range?: UsageRange }): Promise; - /** - * - * @param {string} databaseId - Database ID. - * @param {UsageRange} range - Date range. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getUsage(databaseId: string, range?: UsageRange): Promise; - getUsage( - paramsOrFirst: { databaseId: string, range?: UsageRange } | string, - ...rest: [(UsageRange)?] - ): Promise { - let params: { databaseId: string, range?: UsageRange }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, range?: UsageRange }; - } else { - params = { - databaseId: paramsOrFirst as string, - range: rest[0] as UsageRange - }; - } - - const databaseId = params.databaseId; - const range = params.range; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - - const apiPath = '/vectorsdb/{databaseId}/usage'.replace('{databaseId}', databaseId); - const payload: Payload = {}; - if (typeof range !== 'undefined') { - payload['range'] = range; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } -} From fe800a5823437ffa4ba3927a9be926c35e7f1618 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Mar 2026 06:41:40 +0000 Subject: [PATCH 4/9] chore: update Console SDK to 7.0.0 --- src/enums/documents-db-index-type.ts | 6 - src/enums/model.ts | 3 - src/enums/scopes.ts | 69 +- src/enums/template-reference-type.ts | 2 +- src/enums/use-cases.ts | 12 +- src/enums/vcs-reference-type.ts | 1 - src/enums/vectors-db-index-type.ts | 8 - src/index.ts | 15 +- src/models.ts | 10246 ++++++++++++------------- 9 files changed, 4920 insertions(+), 5442 deletions(-) delete mode 100644 src/enums/documents-db-index-type.ts delete mode 100644 src/enums/model.ts delete mode 100644 src/enums/vectors-db-index-type.ts diff --git a/src/enums/documents-db-index-type.ts b/src/enums/documents-db-index-type.ts deleted file mode 100644 index 8b65e173..00000000 --- a/src/enums/documents-db-index-type.ts +++ /dev/null @@ -1,6 +0,0 @@ -export enum DocumentsDBIndexType { - Key = 'key', - Fulltext = 'fulltext', - Unique = 'unique', - Spatial = 'spatial', -} \ No newline at end of file diff --git a/src/enums/model.ts b/src/enums/model.ts deleted file mode 100644 index 78e605e3..00000000 --- a/src/enums/model.ts +++ /dev/null @@ -1,3 +0,0 @@ -export enum Model { - Embeddinggemma = 'embeddinggemma', -} \ No newline at end of file diff --git a/src/enums/scopes.ts b/src/enums/scopes.ts index d85b2bb5..a30e13ea 100644 --- a/src/enums/scopes.ts +++ b/src/enums/scopes.ts @@ -1,72 +1,5 @@ export enum Scopes { - SessionsWrite = 'sessions.write', - UsersRead = 'users.read', - UsersWrite = 'users.write', + Account = 'account', TeamsRead = 'teams.read', TeamsWrite = 'teams.write', - DatabasesRead = 'databases.read', - DatabasesWrite = 'databases.write', - CollectionsRead = 'collections.read', - CollectionsWrite = 'collections.write', - TablesRead = 'tables.read', - TablesWrite = 'tables.write', - AttributesRead = 'attributes.read', - AttributesWrite = 'attributes.write', - ColumnsRead = 'columns.read', - ColumnsWrite = 'columns.write', - IndexesRead = 'indexes.read', - IndexesWrite = 'indexes.write', - DocumentsRead = 'documents.read', - DocumentsWrite = 'documents.write', - RowsRead = 'rows.read', - RowsWrite = 'rows.write', - FilesRead = 'files.read', - FilesWrite = 'files.write', - BucketsRead = 'buckets.read', - BucketsWrite = 'buckets.write', - FunctionsRead = 'functions.read', - FunctionsWrite = 'functions.write', - SitesRead = 'sites.read', - SitesWrite = 'sites.write', - LogRead = 'log.read', - LogWrite = 'log.write', - ExecutionRead = 'execution.read', - ExecutionWrite = 'execution.write', - LocaleRead = 'locale.read', - AvatarsRead = 'avatars.read', - HealthRead = 'health.read', - ProvidersRead = 'providers.read', - ProvidersWrite = 'providers.write', - MessagesRead = 'messages.read', - MessagesWrite = 'messages.write', - TopicsRead = 'topics.read', - TopicsWrite = 'topics.write', - SubscribersRead = 'subscribers.read', - SubscribersWrite = 'subscribers.write', - TargetsRead = 'targets.read', - TargetsWrite = 'targets.write', - RulesRead = 'rules.read', - RulesWrite = 'rules.write', - SchedulesRead = 'schedules.read', - SchedulesWrite = 'schedules.write', - MigrationsRead = 'migrations.read', - MigrationsWrite = 'migrations.write', - VcsRead = 'vcs.read', - VcsWrite = 'vcs.write', - AssistantRead = 'assistant.read', - TokensRead = 'tokens.read', - TokensWrite = 'tokens.write', - WebhooksRead = 'webhooks.read', - WebhooksWrite = 'webhooks.write', - ProjectRead = 'project.read', - ProjectWrite = 'project.write', - PoliciesWrite = 'policies.write', - PoliciesRead = 'policies.read', - ArchivesRead = 'archives.read', - ArchivesWrite = 'archives.write', - RestorationsRead = 'restorations.read', - RestorationsWrite = 'restorations.write', - DomainsRead = 'domains.read', - DomainsWrite = 'domains.write', - EventsRead = 'events.read', } \ No newline at end of file diff --git a/src/enums/template-reference-type.ts b/src/enums/template-reference-type.ts index c714c2c8..bd72cfb5 100644 --- a/src/enums/template-reference-type.ts +++ b/src/enums/template-reference-type.ts @@ -1,5 +1,5 @@ export enum TemplateReferenceType { - Branch = 'branch', Commit = 'commit', + Branch = 'branch', Tag = 'tag', } \ No newline at end of file diff --git a/src/enums/use-cases.ts b/src/enums/use-cases.ts index d014c1ae..e0a485cd 100644 --- a/src/enums/use-cases.ts +++ b/src/enums/use-cases.ts @@ -1,11 +1,9 @@ export enum UseCases { - Portfolio = 'portfolio', Starter = 'starter', - Events = 'events', - Ecommerce = 'ecommerce', - Documentation = 'documentation', - Blog = 'blog', + Databases = 'databases', Ai = 'ai', - Forms = 'forms', - Dashboard = 'dashboard', + Messaging = 'messaging', + Utilities = 'utilities', + Devtools = 'dev-tools', + Auth = 'auth', } \ No newline at end of file diff --git a/src/enums/vcs-reference-type.ts b/src/enums/vcs-reference-type.ts index cb5270f5..5bbae171 100644 --- a/src/enums/vcs-reference-type.ts +++ b/src/enums/vcs-reference-type.ts @@ -1,5 +1,4 @@ export enum VCSReferenceType { Branch = 'branch', Commit = 'commit', - Tag = 'tag', } \ No newline at end of file diff --git a/src/enums/vectors-db-index-type.ts b/src/enums/vectors-db-index-type.ts deleted file mode 100644 index a38d5ea1..00000000 --- a/src/enums/vectors-db-index-type.ts +++ /dev/null @@ -1,8 +0,0 @@ -export enum VectorsDBIndexType { - HnswEuclidean = 'hnsw_euclidean', - HnswDot = 'hnsw_dot', - HnswCosine = 'hnsw_cosine', - Object = 'object', - Key = 'key', - Unique = 'unique', -} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index de9d3e79..da3882ab 100644 --- a/src/index.ts +++ b/src/index.ts @@ -60,7 +60,6 @@ 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'; @@ -102,20 +101,18 @@ 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 { VectorsDBIndexType } from './enums/vectors-db-index-type'; +export { BillingPlanGroup } from './enums/billing-plan-group'; export { DatabaseType } from './enums/database-type'; export { AttributeStatus } from './enums/attribute-status'; -export { ColumnStatus } from './enums/column-status'; export { IndexStatus } from './enums/index-status'; +export { DomainTransferStatusEnum } from './enums/domain-transfer-status-enum'; +export { DomainPurchaseStatus } from './enums/domain-purchase-status'; export { DeploymentStatus } from './enums/deployment-status'; export { ExecutionTrigger } from './enums/execution-trigger'; export { ExecutionStatus } from './enums/execution-status'; -export { HealthAntivirusStatus } from './enums/health-antivirus-status'; export { HealthCheckStatus } from './enums/health-check-status'; +export { HealthAntivirusStatus } from './enums/health-antivirus-status'; +export { MessageStatus } from './enums/message-status'; export { ProxyRuleDeploymentResourceType } from './enums/proxy-rule-deployment-resource-type'; export { ProxyRuleStatus } from './enums/proxy-rule-status'; -export { MessageStatus } from './enums/message-status'; -export { BillingPlanGroup } from './enums/billing-plan-group'; -export { DomainTransferStatusEnum } from './enums/domain-transfer-status-enum'; -export { DomainPurchaseStatus } from './enums/domain-purchase-status'; +export { ColumnStatus } from './enums/column-status'; diff --git a/src/models.ts b/src/models.ts index bafa73b3..fb89b504 100644 --- a/src/models.ts +++ b/src/models.ts @@ -1,19 +1,19 @@ +import { BillingPlanGroup } from "./enums/billing-plan-group" import { DatabaseType } from "./enums/database-type" import { AttributeStatus } from "./enums/attribute-status" -import { ColumnStatus } from "./enums/column-status" import { IndexStatus } from "./enums/index-status" +import { DomainTransferStatusEnum } from "./enums/domain-transfer-status-enum" +import { DomainPurchaseStatus } from "./enums/domain-purchase-status" import { DeploymentStatus } from "./enums/deployment-status" import { ExecutionTrigger } from "./enums/execution-trigger" import { ExecutionStatus } from "./enums/execution-status" -import { PlatformType } from "./enums/platform-type" -import { HealthAntivirusStatus } from "./enums/health-antivirus-status" import { HealthCheckStatus } from "./enums/health-check-status" +import { HealthAntivirusStatus } from "./enums/health-antivirus-status" +import { MessageStatus } from "./enums/message-status" +import { PlatformType } from "./enums/platform-type" import { ProxyRuleDeploymentResourceType } from "./enums/proxy-rule-deployment-resource-type" import { ProxyRuleStatus } from "./enums/proxy-rule-status" -import { MessageStatus } from "./enums/message-status" -import { BillingPlanGroup } from "./enums/billing-plan-group" -import { DomainTransferStatusEnum } from "./enums/domain-transfer-status-enum" -import { DomainPurchaseStatus } from "./enums/domain-purchase-status" +import { ColumnStatus } from "./enums/column-status" /** * Appwrite Models @@ -23,129 +23,183 @@ export namespace Models { declare const __default: unique symbol; /** - * Rows List + * User */ - export type RowList = { + export type User = { /** - * Total number of rows that matched your query. + * User ID. */ - total: number; + $id: string; /** - * List of rows. + * User creation date in ISO 8601 format. */ - rows: Row[]; - } - - /** - * Documents List - */ - export type DocumentList = { + $createdAt: string; /** - * Total number of documents that matched your query. + * User update date in ISO 8601 format. */ - total: number; + $updatedAt: string; /** - * List of documents. + * User name. */ - documents: Document[]; - } - - /** - * Tables List - */ - export type TableList = { + name: string; /** - * Total number of tables that matched your query. + * Hashed user password. */ - total: number; + password?: string; /** - * List of tables. + * Password hashing algorithm. */ - tables: Table[]; - } - - /** - * Collections List - */ - export type CollectionList = { + hash?: string; /** - * Total number of collections that matched your query. + * Password hashing algorithm configuration. */ - total: number; + hashOptions?: object; /** - * List of collections. + * User registration date in ISO 8601 format. */ - collections: Collection[]; - } - - /** - * Databases List - */ - export type DatabaseList = { + registration: string; /** - * Total number of databases that matched your query. + * User status. Pass `true` for enabled and `false` for disabled. */ - total: number; + status: boolean; /** - * List of databases. + * Labels for the user. */ - databases: Database[]; - } - - /** - * Indexes List - */ - export type IndexList = { + labels: string[]; /** - * Total number of indexes that matched your query. + * Password update time in ISO 8601 format. */ - total: number; + passwordUpdate: string; /** - * List of indexes. + * User email address. */ - indexes: Index[]; + email: string; + /** + * User phone number in E.164 format. + */ + phone: string; + /** + * Email verification status. + */ + emailVerification: boolean; + /** + * Phone verification status. + */ + phoneVerification: boolean; + /** + * Multi factor authentication status. + */ + mfa: boolean; + /** + * User preferences as a key-value object + */ + prefs: Preferences; + /** + * A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider. + */ + targets: Target[]; + /** + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + */ + accessedAt: string; + /** + * Whether the user can impersonate other users. + */ + impersonator?: boolean; + /** + * ID of the original actor performing the impersonation. Present only when the current request is impersonating another user. Internal audit logs attribute the action to this user, while the impersonated target is recorded only in internal audit payload data. + */ + impersonatorUserId?: string; } /** - * Column Indexes List + * Billing address list */ - export type ColumnIndexList = { + export type BillingAddressList = { /** - * Total number of indexes that matched your query. + * Total number of billingAddresses that matched your query. */ total: number; /** - * List of indexes. + * List of billingAddresses. */ - indexes: ColumnIndex[]; + billingAddresses: BillingAddress[]; } /** - * Users List + * BillingAddress */ - export type UserList = { + export type BillingAddress = { /** - * Total number of users that matched your query. + * Region ID */ - total: number; + $id: string; /** - * List of users. + * User ID */ - users: User[]; + userId: string; + /** + * Street address + */ + streetAddress: string; + /** + * Address line 2 + */ + addressLine2: string; + /** + * Address country + */ + country: string; + /** + * city + */ + city: string; + /** + * state + */ + state: string; + /** + * postal code + */ + postalCode: string; } /** - * Sessions List + * Coupon */ - export type SessionList = { + export type Coupon = { /** - * Total number of sessions that matched your query. + * coupon ID */ - total: number; + $id: string; /** - * List of sessions. + * coupon ID */ - sessions: Session[]; + code: string; + /** + * Provided credit amount + */ + credits: number; + /** + * Coupon expiration time in ISO 8601 format. + */ + expiration: string; + /** + * Credit validity in days. + */ + validity: number; + /** + * Campaign the coupon is associated with`. + */ + campaign: string; + /** + * Status of the coupon. Can be one of `disabled`, `active` or `expired`. + */ + status: string; + /** + * If the coupon is only valid for new organizations or not. + */ + onlyNewOrgs: boolean; } /** @@ -163,1769 +217,1614 @@ export namespace Models { } /** - * Logs List + * Billing invoices list */ - export type LogList = { + export type InvoiceList = { /** - * Total number of logs that matched your query. + * Total number of invoices that matched your query. */ total: number; /** - * List of logs. + * List of invoices. */ - logs: Log[]; + invoices: Invoice[]; } /** - * Files List + * JWT */ - export type FileList = { - /** - * Total number of files that matched your query. - */ - total: number; + export type Jwt = { /** - * List of files. + * JWT encoded string. */ - files: File[]; + jwt: string; } /** - * Buckets List + * API Keys List */ - export type BucketList = { + export type KeyList = { /** - * Total number of buckets that matched your query. + * Total number of keys that matched your query. */ total: number; /** - * List of buckets. + * List of keys. */ - buckets: Bucket[]; + keys: Key[]; } /** - * Resource Tokens List + * Key */ - export type ResourceTokenList = { + export type Key = { /** - * Total number of tokens that matched your query. + * Key ID. */ - total: number; + $id: string; /** - * List of tokens. + * Key creation date in ISO 8601 format. */ - tokens: ResourceToken[]; - } - - /** - * Teams List - */ - export type TeamList = { + $createdAt: string; /** - * Total number of teams that matched your query. + * Key update date in ISO 8601 format. */ - total: number; + $updatedAt: string; /** - * List of teams. + * Key name. */ - teams: Team[]; - } - - /** - * Memberships List - */ - export type MembershipList = { + name: string; /** - * Total number of memberships that matched your query. + * Key expiration date in ISO 8601 format. */ - total: number; + expire: string; /** - * List of memberships. + * Allowed permission scopes. */ - memberships: Membership[]; - } - - /** - * Sites List - */ - export type SiteList = { + scopes: string[]; /** - * Total number of sites that matched your query. + * Secret key. */ - total: number; + secret: string; /** - * List of sites. + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. */ - sites: Site[]; + accessedAt: string; + /** + * List of SDK user agents that used this key. + */ + sdks: string[]; } /** - * Site Templates List + * Logs List */ - export type TemplateSiteList = { + export type LogList = { /** - * Total number of templates that matched your query. + * Total number of logs that matched your query. */ total: number; /** - * List of templates. + * List of logs. */ - templates: TemplateSite[]; + logs: Log[]; } /** - * Functions List + * MFAType */ - export type FunctionList = { + export type MfaType = { /** - * Total number of functions that matched your query. + * Secret token used for TOTP factor. */ - total: number; + secret: string; /** - * List of functions. + * URI for authenticator apps. */ - functions: Function[]; + uri: string; } /** - * Function Templates List + * MFA Challenge */ - export type TemplateFunctionList = { + export type MfaChallenge = { /** - * Total number of templates that matched your query. + * Token ID. */ - total: number; + $id: string; /** - * List of templates. + * Token creation date in ISO 8601 format. */ - templates: TemplateFunction[]; - } - - /** - * Installations List - */ - export type InstallationList = { + $createdAt: string; /** - * Total number of installations that matched your query. + * User ID. */ - total: number; + userId: string; /** - * List of installations. + * Token expiration date in ISO 8601 format. */ - installations: Installation[]; + expire: string; } /** - * Framework Provider Repositories List + * Session */ - export type ProviderRepositoryFrameworkList = { + export type Session = { /** - * Total number of frameworkProviderRepositories that matched your query. + * Session ID. */ - total: number; + $id: string; /** - * List of frameworkProviderRepositories. + * Session creation date in ISO 8601 format. */ - frameworkProviderRepositories: ProviderRepositoryFramework[]; - } - - /** - * Runtime Provider Repositories List - */ - export type ProviderRepositoryRuntimeList = { + $createdAt: string; /** - * Total number of runtimeProviderRepositories that matched your query. + * Session update date in ISO 8601 format. */ - total: number; + $updatedAt: string; /** - * List of runtimeProviderRepositories. + * User ID. */ - runtimeProviderRepositories: ProviderRepositoryRuntime[]; - } - - /** - * Branches List - */ - export type BranchList = { + userId: string; /** - * Total number of branches that matched your query. + * Session expiration date in ISO 8601 format. */ - total: number; + expire: string; /** - * List of branches. + * Session Provider. */ - branches: Branch[]; - } - - /** - * Frameworks List - */ - export type FrameworkList = { + provider: string; /** - * Total number of frameworks that matched your query. + * Session Provider User ID. */ - total: number; + providerUid: string; /** - * List of frameworks. + * Session Provider Access Token. */ - frameworks: Framework[]; - } - - /** - * Runtimes List - */ - export type RuntimeList = { + providerAccessToken: string; /** - * Total number of runtimes that matched your query. + * The date of when the access token expires in ISO 8601 format. */ - total: number; + providerAccessTokenExpiry: string; /** - * List of runtimes. + * Session Provider Refresh Token. */ - runtimes: Runtime[]; - } - - /** - * Deployments List - */ - export type DeploymentList = { + providerRefreshToken: string; /** - * Total number of deployments that matched your query. + * IP in use when the session was created. */ - total: number; + ip: string; /** - * List of deployments. + * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). */ - deployments: Deployment[]; - } - - /** - * Executions List - */ - export type ExecutionList = { + osCode: string; /** - * Total number of executions that matched your query. + * Operating system name. */ - total: number; + osName: string; /** - * List of executions. + * Operating system version. */ - executions: Execution[]; - } - - /** - * Projects List - */ - export type ProjectList = { + osVersion: string; /** - * Total number of projects that matched your query. + * Client type. */ - total: number; + clientType: string; /** - * List of projects. + * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). */ - projects: Project[]; - } - - /** - * Webhooks List - */ - export type WebhookList = { + clientCode: string; /** - * Total number of webhooks that matched your query. + * Client name. */ - total: number; + clientName: string; /** - * List of webhooks. + * Client version. */ - webhooks: Webhook[]; - } - - /** - * API Keys List - */ - export type KeyList = { + clientVersion: string; /** - * Total number of keys that matched your query. + * Client engine name. */ - total: number; + clientEngine: string; /** - * List of keys. + * Client engine name. */ - keys: Key[]; - } - - /** - * Dev Keys List - */ - export type DevKeyList = { + clientEngineVersion: string; /** - * Total number of devKeys that matched your query. + * Device name. */ - total: number; + deviceName: string; /** - * List of devKeys. + * Device brand name. */ - devKeys: DevKey[]; - } - - /** - * Platforms List - */ - export type PlatformList = { + deviceBrand: string; /** - * Total number of platforms that matched your query. + * Device model name. */ - total: number; + deviceModel: string; /** - * List of platforms. + * Country two-character ISO 3166-1 alpha code. */ - platforms: Platform[]; - } - - /** - * Countries List - */ - export type CountryList = { - /** - * Total number of countries that matched your query. - */ - total: number; + countryCode: string; /** - * List of countries. + * Country name. */ - countries: Country[]; - } - - /** - * Continents List - */ - export type ContinentList = { + countryName: string; /** - * Total number of continents that matched your query. + * Returns true if this the current user session. */ - total: number; + current: boolean; /** - * List of continents. + * Returns a list of active session factors. */ - continents: Continent[]; - } - - /** - * Languages List - */ - export type LanguageList = { + factors: string[]; /** - * Total number of languages that matched your query. + * Secret used to authenticate the user. Only included if the request was made with an API key */ - total: number; + secret: string; /** - * List of languages. + * Most recent date in ISO 8601 format when the session successfully passed MFA challenge. */ - languages: Language[]; + mfaUpdatedAt: string; } /** - * Currencies List + * MFAFactors */ - export type CurrencyList = { + export type MfaFactors = { /** - * Total number of currencies that matched your query. + * Can TOTP be used for MFA challenge for this account. */ - total: number; + totp: boolean; /** - * List of currencies. + * Can phone (SMS) be used for MFA challenge for this account. */ - currencies: Currency[]; - } - - /** - * Phones List - */ - export type PhoneList = { + phone: boolean; /** - * Total number of phones that matched your query. + * Can email be used for MFA challenge for this account. */ - total: number; + email: boolean; /** - * List of phones. + * Can recovery code be used for MFA challenge for this account. */ - phones: Phone[]; + recoveryCode: boolean; } /** - * Variables List + * MFA Recovery Codes */ - export type VariableList = { - /** - * Total number of variables that matched your query. - */ - total: number; + export type MfaRecoveryCodes = { /** - * List of variables. + * Recovery codes. */ - variables: Variable[]; + recoveryCodes: string[]; } /** - * Status List + * Payment methods list */ - export type HealthStatusList = { + export type PaymentMethodList = { /** - * Total number of statuses that matched your query. + * Total number of paymentMethods that matched your query. */ total: number; /** - * List of statuses. + * List of paymentMethods. */ - statuses: HealthStatus[]; + paymentMethods: PaymentMethod[]; } /** - * Rule List + * paymentMethod */ - export type ProxyRuleList = { + export type PaymentMethod = { /** - * Total number of rules that matched your query. + * Payment Method ID. */ - total: number; + $id: string; /** - * List of rules. + * Payment method creation time in ISO 8601 format. */ - rules: ProxyRule[]; - } - - /** - * Schedules List - */ - export type ScheduleList = { + $createdAt: string; /** - * Total number of schedules that matched your query. + * Payment method update date in ISO 8601 format. */ - total: number; + $updatedAt: string; /** - * List of schedules. + * Payment method permissions. [Learn more about permissions](/docs/permissions). */ - schedules: Schedule[]; - } - - /** - * Locale codes list - */ - export type LocaleCodeList = { + $permissions: string[]; /** - * Total number of localeCodes that matched your query. + * Payment method ID from the payment provider */ - total: number; + providerMethodId: string; /** - * List of localeCodes. + * Client secret hash for payment setup */ - localeCodes: LocaleCode[]; - } - - /** - * Provider list - */ - export type ProviderList = { + clientSecret: string; /** - * Total number of providers that matched your query. + * User ID from the payment provider. */ - total: number; + providerUserId: string; /** - * List of providers. + * ID of the Team. */ - providers: Provider[]; - } - - /** - * Message list - */ - export type MessageList = { + userId: string; /** - * Total number of messages that matched your query. + * Expiry month of the payment method. */ - total: number; + expiryMonth: number; /** - * List of messages. + * Expiry year of the payment method. */ - messages: Message[]; - } - - /** - * Topic list - */ - export type TopicList = { + expiryYear: number; /** - * Total number of topics that matched your query. + * Last 4 digit of the payment method */ - total: number; + last4: string; /** - * List of topics. + * Payment method brand */ - topics: Topic[]; - } - - /** - * Subscriber list - */ - export type SubscriberList = { + brand: string; /** - * Total number of subscribers that matched your query. + * Name of the owner */ - total: number; + name: string; /** - * List of subscribers. + * Mandate ID of the payment method */ - subscribers: Subscriber[]; - } - - /** - * Target list - */ - export type TargetList = { + mandateId: string; /** - * Total number of targets that matched your query. + * Country of the payment method */ - total: number; + country: string; /** - * List of targets. + * State of the payment method */ - targets: Target[]; - } - - /** - * Transaction List - */ - export type TransactionList = { + state: string; /** - * Total number of transactions that matched your query. + * Last payment error associated with the payment method. */ - total: number; + lastError: string; /** - * List of transactions. + * True when it's the default payment method. */ - transactions: Transaction[]; - } - - /** - * Migrations List - */ - export type MigrationList = { + default: boolean; /** - * Total number of migrations that matched your query. + * True when payment method has expired. */ - total: number; + expired: boolean; /** - * List of migrations. + * True when payment method has failed to process multiple times. */ - migrations: Migration[]; + failed: boolean; } /** - * Specifications List + * Preferences */ - export type SpecificationList = { - /** - * Total number of specifications that matched your query. - */ - total: number; - /** - * List of specifications. - */ - specifications: Specification[]; + export type Preferences = { } + export type DefaultPreferences = Preferences & { + [key: string]: any; + [__default]: true; + }; + /** - * VCS Content List + * Token */ - export type VcsContentList = { + export type Token = { /** - * Total number of contents that matched your query. + * Token ID. */ - total: number; + $id: string; /** - * List of contents. + * Token creation date in ISO 8601 format. */ - contents: VcsContent[]; - } - - /** - * VectorsDB Collections List - */ - export type VectorsdbCollectionList = { + $createdAt: string; /** - * Total number of collections that matched your query. + * User ID. */ - total: number; + userId: string; /** - * List of collections. + * Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. + */ + secret: string; + /** + * Token expiration date in ISO 8601 format. */ - collections: VectorsdbCollection[]; + expire: string; + /** + * Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email. + */ + phrase: string; } /** - * Embedding list + * Sessions List */ - export type EmbeddingList = { + export type SessionList = { /** - * Total number of embeddings that matched your query. + * Total number of sessions that matched your query. */ total: number; /** - * List of embeddings. + * List of sessions. */ - embeddings: Embedding[]; + sessions: Session[]; } /** - * Database + * Target */ - export type Database = { + export type Target = { /** - * Database ID. + * Target ID. */ $id: string; /** - * Database name. - */ - name: string; - /** - * Database creation date in ISO 8601 format. + * Target creation time in ISO 8601 format. */ $createdAt: string; /** - * Database update date in ISO 8601 format. + * Target update date in ISO 8601 format. */ $updatedAt: string; /** - * If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys. + * Target Name. */ - enabled: boolean; + name: string; /** - * Database type. + * User ID. */ - type: DatabaseType; + userId: string; /** - * Database backup policies. + * Provider ID. */ - policies: Index[]; + providerId?: string; /** - * Database backup archives. + * The target provider type. Can be one of the following: `email`, `sms` or `push`. */ - archives: Collection[]; - } - - /** - * Embedding - */ - export type Embedding = { + providerType: string; /** - * Embedding model used to generate embeddings. + * The target identifier. */ - model: string; + identifier: string; /** - * Number of dimensions for each embedding vector. + * Is the target expired. */ - dimension: number; + expired: boolean; + } + + /** + * Activity event list + */ + export type ActivityEventList = { /** - * Embedding vector values. If an error occurs, this will be an empty array. + * Total number of events that matched your query. */ - embedding: number[]; + total: number; /** - * Error message if embedding generation fails. Empty string if no error. + * List of events. */ - error: string; + events: ActivityEvent[]; } /** - * Collection + * ActivityEvent */ - export type Collection = { + export type ActivityEvent = { /** - * Collection ID. + * Event ID. */ $id: string; /** - * Collection creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Collection update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Collection permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * User type. */ - $permissions: string[]; + userType: string; /** - * Database ID. + * User ID. */ - databaseId: string; + userId: string; /** - * Collection name. + * User Email. */ - name: string; + userEmail: string; /** - * Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys. + * User Name. */ - enabled: boolean; + userName: string; /** - * Whether document-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). + * Resource parent. */ - documentSecurity: boolean; + resourceParent: string; /** - * Collection attributes. + * Resource type. */ - attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributePoint | Models.AttributeLine | Models.AttributePolygon | Models.AttributeVarchar | Models.AttributeText | Models.AttributeMediumtext | Models.AttributeLongtext | Models.AttributeString)[]; + resourceType: string; /** - * Collection indexes. + * Resource ID. */ - indexes: Index[]; + resourceId: string; /** - * Maximum document size in bytes. Returns 0 when no limit applies. + * Resource. */ - bytesMax: number; + resource: string; /** - * Currently used document size in bytes based on defined attributes. + * Event name. */ - bytesUsed: number; - } - - /** - * Attributes List - */ - export type AttributeList = { + event: string; /** - * Total number of attributes in the given collection. + * User agent. */ - total: number; + userAgent: string; /** - * List of attributes. + * IP address. */ - attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributePoint | Models.AttributeLine | Models.AttributePolygon | Models.AttributeVarchar | Models.AttributeText | Models.AttributeMediumtext | Models.AttributeLongtext | Models.AttributeString)[]; - } - - /** - * AttributeString - */ - export type AttributeString = { + ip: string; /** - * Attribute Key. + * API mode when event triggered. */ - key: string; + mode: string; /** - * Attribute type. + * Location. */ - type: string; + country: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Log creation date in ISO 8601 format. */ - status: AttributeStatus; + time: string; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Project ID. */ - error: string; + projectId: string; /** - * Is attribute required? + * Team ID. */ - required: boolean; + teamId: string; /** - * Is attribute an array? + * Hostname. */ - array?: boolean; + hostname: string; /** - * Attribute creation date in ISO 8601 format. + * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). */ - $createdAt: string; + osCode: string; /** - * Attribute update date in ISO 8601 format. + * Operating system name. */ - $updatedAt: string; + osName: string; /** - * Attribute size. + * Operating system version. */ - size: number; + osVersion: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Client type. */ - default?: string; + clientType: string; /** - * Defines whether this attribute is encrypted or not. + * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). */ - encrypt?: boolean; - } - - /** - * AttributeInteger - */ - export type AttributeInteger = { + clientCode: string; /** - * Attribute Key. + * Client name. */ - key: string; + clientName: string; /** - * Attribute type. + * Client version. */ - type: string; + clientVersion: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Client engine name. */ - status: AttributeStatus; + clientEngine: string; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Client engine name. */ - error: string; + clientEngineVersion: string; /** - * Is attribute required? + * Device name. */ - required: boolean; + deviceName: string; /** - * Is attribute an array? + * Device brand name. */ - array?: boolean; + deviceBrand: string; /** - * Attribute creation date in ISO 8601 format. + * Device model name. */ - $createdAt: string; + deviceModel: string; /** - * Attribute update date in ISO 8601 format. + * Country two-character ISO 3166-1 alpha code. */ - $updatedAt: string; + countryCode: string; /** - * Minimum value to enforce for new documents. + * Country name. */ - min?: number | bigint; + countryName: string; + } + + /** + * Backup archive list + */ + export type BackupArchiveList = { /** - * Maximum value to enforce for new documents. + * Total number of archives that matched your query. */ - max?: number | bigint; + total: number; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * List of archives. */ - default?: number; + archives: BackupArchive[]; } /** - * AttributeFloat + * Archive */ - export type AttributeFloat = { + export type BackupArchive = { /** - * Attribute Key. + * Archive ID. */ - key: string; + $id: string; /** - * Attribute type. - */ - type: string; - /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` - */ - status: AttributeStatus; - /** - * Error message. Displays error generated on failure of creating or deleting an attribute. - */ - error: string; - /** - * Is attribute required? - */ - required: boolean; - /** - * Is attribute an array? - */ - array?: boolean; - /** - * Attribute creation date in ISO 8601 format. + * Archive creation time in ISO 8601 format. */ $createdAt: string; /** - * Attribute update date in ISO 8601 format. + * Archive update date in ISO 8601 format. */ $updatedAt: string; /** - * Minimum value to enforce for new documents. - */ - min?: number; - /** - * Maximum value to enforce for new documents. + * Archive policy ID. */ - max?: number; + policyId: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Archive size in bytes. */ - default?: number; - } - - /** - * AttributeBoolean - */ - export type AttributeBoolean = { + size: number; /** - * Attribute Key. + * The status of the archive creation. Possible values: pending, processing, uploading, completed, failed. */ - key: string; + status: string; /** - * Attribute type. + * The backup start time. */ - type: string; + startedAt: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Migration ID. */ - status: AttributeStatus; + migrationId: string; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * The services that are backed up by this archive. */ - error: string; + services: string[]; /** - * Is attribute required? + * The resources that are backed up by this archive. */ - required: boolean; + resources: string[]; /** - * Is attribute an array? + * The resource ID to backup. Set only if this archive should backup a single resource. */ - array?: boolean; + resourceId?: string; /** - * Attribute creation date in ISO 8601 format. + * The resource type to backup. Set only if this archive should backup a single resource. */ - $createdAt: string; + resourceType?: string; + } + + /** + * Backup policy list + */ + export type BackupPolicyList = { /** - * Attribute update date in ISO 8601 format. + * Total number of policies that matched your query. */ - $updatedAt: string; + total: number; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * List of policies. */ - default?: boolean; + policies: BackupPolicy[]; } /** - * AttributeEmail + * backup */ - export type AttributeEmail = { + export type BackupPolicy = { /** - * Attribute Key. + * Backup policy ID. */ - key: string; + $id: string; /** - * Attribute type. + * Backup policy name. */ - type: string; + name: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Policy creation date in ISO 8601 format. */ - status: AttributeStatus; + $createdAt: string; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Policy update date in ISO 8601 format. */ - error: string; + $updatedAt: string; /** - * Is attribute required? + * The services that are backed up by this policy. */ - required: boolean; + services: string[]; /** - * Is attribute an array? + * The resources that are backed up by this policy. */ - array?: boolean; + resources: string[]; /** - * Attribute creation date in ISO 8601 format. + * The resource ID to backup. Set only if this policy should backup a single resource. */ - $createdAt: string; + resourceId?: string; /** - * Attribute update date in ISO 8601 format. + * The resource type to backup. Set only if this policy should backup a single resource. */ - $updatedAt: string; + resourceType?: string; /** - * String format. + * How many days to keep the backup before it will be automatically deleted. */ - format: string; + retention: number; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Policy backup schedule in CRON format. */ - default?: string; + schedule: string; + /** + * Is this policy enabled. + */ + enabled: boolean; } /** - * AttributeEnum + * Restoration */ - export type AttributeEnum = { + export type BackupRestoration = { /** - * Attribute Key. + * Restoration ID. */ - key: string; + $id: string; /** - * Attribute type. + * Restoration creation time in ISO 8601 format. */ - type: string; + $createdAt: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Restoration update date in ISO 8601 format. */ - status: AttributeStatus; + $updatedAt: string; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Backup archive ID. */ - error: string; + archiveId: string; /** - * Is attribute required? + * Backup policy ID. */ - required: boolean; + policyId: string; /** - * Is attribute an array? + * The status of the restoration. Possible values: pending, downloading, processing, completed, failed. */ - array?: boolean; + status: string; /** - * Attribute creation date in ISO 8601 format. + * The backup start time. */ - $createdAt: string; + startedAt: string; /** - * Attribute update date in ISO 8601 format. + * Migration ID. */ - $updatedAt: string; + migrationId: string; /** - * Array of elements in enumerated type. + * The services that are backed up by this policy. */ - elements: string[]; + services: string[]; /** - * String format. + * The resources that are backed up by this policy. */ - format: string; + resources: string[]; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Optional data in key-value object. */ - default?: string; + options: string; } /** - * AttributeIP + * Backup restoration list */ - export type AttributeIp = { + export type BackupRestorationList = { /** - * Attribute Key. + * Total number of restorations that matched your query. */ - key: string; + total: number; /** - * Attribute type. + * List of restorations. */ - type: string; + restorations: BackupRestoration[]; + } + + /** + * Campaign + */ + export type Campaign = { /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Campaign ID */ - status: AttributeStatus; + $id: string; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Campaign template */ - error: string; + template: string; /** - * Is attribute required? + * Campaign title */ - required: boolean; + title: string; /** - * Is attribute an array? + * Campaign description */ - array?: boolean; + description: string; /** - * Attribute creation date in ISO 8601 format. + * Billing plan campaign is associated with */ - $createdAt: string; + plan?: string; /** - * Attribute update date in ISO 8601 format. + * Campaign CTA */ - $updatedAt: string; + cta?: string; /** - * String format. + * Campaign info when claimed */ - format: string; + claimed?: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Campaign infor when unclaimed */ - default?: string; - } - - /** - * AttributeURL - */ - export type AttributeUrl = { + unclaimed?: string; /** - * Attribute Key. + * Campaign images */ - key: string; + image?: object; /** - * Attribute type. + * Campaign reviews */ - type: string; + reviews?: Review[]; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Campaign valid only for new orgs. */ - status: AttributeStatus; + onlyNewOrgs?: boolean; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Is footer */ - error: string; + footer?: boolean; + } + + /** + * Billing plan list + */ + export type BillingPlanList = { /** - * Is attribute required? + * Total number of plans that matched your query. */ - required: boolean; + total: number; /** - * Is attribute an array? + * List of plans. */ - array?: boolean; + plans: BillingPlan[]; + } + + /** + * billingPlan + */ + export type BillingPlan = { /** - * Attribute creation date in ISO 8601 format. + * Plan ID. */ - $createdAt: string; + $id: string; /** - * Attribute update date in ISO 8601 format. + * Plan name */ - $updatedAt: string; + name: string; /** - * String format. + * Plan description */ - format: string; + desc: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Plan order */ - default?: string; - } - - /** - * AttributeDatetime - */ - export type AttributeDatetime = { + order: number; /** - * Attribute Key. + * Price */ - key: string; + price: number; /** - * Attribute type. + * Trial days */ - type: string; + trial: number; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Bandwidth */ - status: AttributeStatus; + bandwidth: number; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Storage */ - error: string; + storage: number; /** - * Is attribute required? + * Image Transformations */ - required: boolean; + imageTransformations: number; /** - * Is attribute an array? + * Screenshots generated */ - array?: boolean; + screenshotsGenerated: number; /** - * Attribute creation date in ISO 8601 format. + * Members */ - $createdAt: string; + members: number; /** - * Attribute update date in ISO 8601 format. + * Webhooks */ - $updatedAt: string; + webhooks: number; /** - * ISO 8601 format. + * Projects */ - format: string; + projects: number; /** - * Default value for attribute when not provided. Only null is optional + * Platforms */ - default?: string; - } - - /** - * AttributeRelationship - */ - export type AttributeRelationship = { + platforms: number; /** - * Attribute Key. + * Users */ - key: string; + users: number; /** - * Attribute type. + * Teams */ - type: string; + teams: number; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Databases */ - status: AttributeStatus; + databases: number; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Database reads per month */ - error: string; + databasesReads: number; /** - * Is attribute required? + * Database writes per month */ - required: boolean; + databasesWrites: number; /** - * Is attribute an array? + * Database batch size limit */ - array?: boolean; + databasesBatchSize: number; /** - * Attribute creation date in ISO 8601 format. + * Buckets */ - $createdAt: string; + buckets: number; /** - * Attribute update date in ISO 8601 format. + * File size */ - $updatedAt: string; + fileSize: number; /** - * The ID of the related collection. + * Functions */ - relatedCollection: string; + functions: number; /** - * The type of the relationship. + * Sites */ - relationType: string; + sites: number; /** - * Is the relationship two-way? + * Function executions */ - twoWay: boolean; + executions: number; /** - * The key of the two-way relationship. + * Rolling max executions retained per function/site */ - twoWayKey: string; + executionsRetentionCount: number; /** - * How deleting the parent document will propagate to child documents. + * GB hours for functions */ - onDelete: string; + GBHours: number; /** - * Whether this is the parent or child side of the relationship + * Realtime connections */ - side: string; - } - - /** - * AttributePoint - */ - export type AttributePoint = { + realtime: number; /** - * Attribute Key. + * Realtime messages */ - key: string; + realtimeMessages: number; /** - * Attribute type. + * Messages per month */ - type: string; + messages: number; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Topics for messaging */ - status: AttributeStatus; + topics: number; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * SMS authentications per month */ - error: string; + authPhone: number; /** - * Is attribute required? + * Custom domains */ - required: boolean; + domains: number; /** - * Is attribute an array? + * Log days */ - array?: boolean; + logs: number; /** - * Attribute creation date in ISO 8601 format. + * Number of days of console inactivity before a project is paused. 0 means pausing is disabled. */ - $createdAt: string; + projectInactivityDays: number; /** - * Attribute update date in ISO 8601 format. + * Alert threshold percentage */ - $updatedAt: string; + alertLimit: number; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Additional resources */ - default?: any[]; - } - - /** - * AttributeLine - */ - export type AttributeLine = { + usage: UsageBillingPlan; /** - * Attribute Key. + * Addons */ - key: string; + addons: BillingPlanAddon; /** - * Attribute type. + * Budget cap enabled or disabled. */ - type: string; + budgetCapEnabled: boolean; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Custom SMTP */ - status: AttributeStatus; + customSmtp: boolean; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Appwrite branding in email */ - error: string; + emailBranding: boolean; /** - * Is attribute required? + * Does plan require payment method */ - required: boolean; + requiresPaymentMethod: boolean; /** - * Is attribute an array? + * Does plan require billing address */ - array?: boolean; + requiresBillingAddress: boolean; /** - * Attribute creation date in ISO 8601 format. + * Is the billing plan available */ - $createdAt: string; + isAvailable: boolean; /** - * Attribute update date in ISO 8601 format. + * Can user change the plan themselves */ - $updatedAt: string; + selfService: boolean; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Does plan enable premium support */ - default?: any[]; - } - - /** - * AttributePolygon - */ - export type AttributePolygon = { + premiumSupport: boolean; /** - * Attribute Key. + * Does plan support budget cap */ - key: string; + budgeting: boolean; /** - * Attribute type. + * Does plan support mock numbers */ - type: string; + supportsMockNumbers: boolean; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Does plan support organization roles */ - status: AttributeStatus; + supportsOrganizationRoles: boolean; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Does plan support credit */ - error: string; + supportsCredits: boolean; /** - * Is attribute required? + * Does plan support backup policies. */ - required: boolean; + backupsEnabled: boolean; /** - * Is attribute an array? + * Whether usage addons are calculated per project. */ - array?: boolean; + usagePerProject: boolean; /** - * Attribute creation date in ISO 8601 format. + * How many policies does plan support */ - $createdAt: string; + backupPolicies: number; /** - * Attribute update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Default value for attribute when not provided. Cannot be set when attribute is required. - */ - default?: any[]; - } - - /** - * AttributeVarchar - */ - export type AttributeVarchar = { - /** - * Attribute Key. - */ - key: string; - /** - * Attribute type. + * Maximum function and site deployment size in MB */ - type: string; + deploymentSize: number; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Maximum function and site deployment size in MB */ - status: AttributeStatus; + buildSize: number; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Does the plan support encrypted string attributes or not. */ - error: string; + databasesAllowEncrypt: boolean; /** - * Is attribute required? + * Plan specific limits */ - required: boolean; + limits?: BillingPlanLimits; /** - * Is attribute an array? + * Group of this billing plan for variants */ - array?: boolean; + group: BillingPlanGroup; /** - * Attribute creation date in ISO 8601 format. + * Details of the program this plan is a part of. */ - $createdAt: string; + program?: Program; + } + + /** + * Program + */ + export type Program = { /** - * Attribute update date in ISO 8601 format. + * Program ID */ - $updatedAt: string; + $id: string; /** - * Attribute size. + * Program title */ - size: number; + title: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Program description */ - default?: string; + description: string; /** - * Defines whether this attribute is encrypted or not. + * Program tag for highlighting on console */ - encrypt?: boolean; - } - - /** - * AttributeText - */ - export type AttributeText = { + tag: string; /** - * Attribute Key. + * Program icon for highlighting on console */ - key: string; + icon: string; /** - * Attribute type. + * URL for more information on this program */ - type: string; + url: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Whether this program is active */ - status: AttributeStatus; + active: boolean; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Whether this program is external */ - error: string; + external: boolean; /** - * Is attribute required? + * Billing plan ID that this is program is associated with. */ - required: boolean; + billingPlanId: string; + } + + /** + * Organization + */ + export type Organization = { /** - * Is attribute an array? + * Team ID. */ - array?: boolean; + $id: string; /** - * Attribute creation date in ISO 8601 format. + * Team creation date in ISO 8601 format. */ $createdAt: string; /** - * Attribute update date in ISO 8601 format. + * Team update date in ISO 8601 format. */ $updatedAt: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. - */ - default?: string; - /** - * Defines whether this attribute is encrypted or not. + * Team name. */ - encrypt?: boolean; - } - - /** - * AttributeMediumtext - */ - export type AttributeMediumtext = { + name: string; /** - * Attribute Key. + * Total number of team members. */ - key: string; + total: number; /** - * Attribute type. + * Team preferences as a key-value object */ - type: string; + prefs: Preferences; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Project budget limit */ - status: AttributeStatus; + billingBudget: number; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Project budget limit */ - error: string; + budgetAlerts: number[]; /** - * Is attribute required? + * Organization's billing plan ID. */ - required: boolean; + billingPlan: string; /** - * Is attribute an array? + * Organization's billing plan ID. */ - array?: boolean; + billingPlanId: string; /** - * Attribute creation date in ISO 8601 format. + * Organization's billing plan. */ - $createdAt: string; + billingPlanDetails: BillingPlan; /** - * Attribute update date in ISO 8601 format. + * Billing email set for the organization. */ - $updatedAt: string; + billingEmail: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Billing cycle start date. */ - default?: string; + billingStartDate: string; /** - * Defines whether this attribute is encrypted or not. + * Current invoice cycle start date. */ - encrypt?: boolean; - } - - /** - * AttributeLongtext - */ - export type AttributeLongtext = { + billingCurrentInvoiceDate: string; /** - * Attribute Key. + * Next invoice cycle start date. */ - key: string; + billingNextInvoiceDate: string; /** - * Attribute type. + * Start date of trial. */ - type: string; + billingTrialStartDate: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Number of trial days. */ - status: AttributeStatus; + billingTrialDays: number; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Current active aggregation id. */ - error: string; + billingAggregationId: string; /** - * Is attribute required? + * Current active aggregation id. */ - required: boolean; + billingInvoiceId: string; /** - * Is attribute an array? + * Default payment method. */ - array?: boolean; + paymentMethodId: string; /** - * Attribute creation date in ISO 8601 format. + * Default payment method. */ - $createdAt: string; + billingAddressId: string; /** - * Attribute update date in ISO 8601 format. + * Backup payment method. */ - $updatedAt: string; + backupPaymentMethodId: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Team status. */ - default?: string; + status: string; /** - * Defines whether this attribute is encrypted or not. + * Remarks on team status. */ - encrypt?: boolean; - } - - /** - * UsageDocumentsDB - */ - export type UsageDocumentsDB = { + remarks: string; /** - * Time range of the usage stats. + * Organization agreements */ - range: string; + agreementBAA: string; /** - * Total aggregated number of collections. + * Program manager's name. */ - collectionsTotal: number; + programManagerName: string; /** - * Total aggregated number of documents. + * Program manager's calendar link. */ - documentsTotal: number; + programManagerCalendar: string; /** - * Total aggregated storage used in bytes. + * Program's discord channel name. */ - storageTotal: number; + programDiscordChannelName: string; /** - * Total number of database reads. + * Program's discord channel URL. */ - databaseReadsTotal: number; + programDiscordChannelUrl: string; /** - * Total number of database writes. + * Billing limits reached */ - databaseWritesTotal: number; + billingLimits: BillingLimits; /** - * Aggregated number of collections per period. + * Billing plan selected for downgrade. */ - collections: Metric[]; + billingPlanDowngrade: string; /** - * Aggregated number of documents per period. + * Tax Id */ - documents: Metric[]; + billingTaxId: string; /** - * Aggregated storage used in bytes per period. + * Marked for deletion */ - storage: Metric[]; + markedForDeletion: boolean; /** - * An array of aggregated number of database reads. + * Product with which the organization is associated (appwrite or imagine) */ - databaseReads: Metric[]; + platform: string; /** - * An array of aggregated number of database writes. + * Selected projects */ - databaseWrites: Metric[]; + projects: string[]; } /** - * VectorsDB Collection + * Regions list */ - export type VectorsdbCollection = { + export type ConsoleRegionList = { /** - * Collection ID. + * Total number of regions that matched your query. */ - $id: string; + total: number; /** - * Collection creation date in ISO 8601 format. + * List of regions. */ - $createdAt: string; + regions: ConsoleRegion[]; + } + + /** + * Columns List + */ + export type ColumnList = { /** - * Collection update date in ISO 8601 format. + * Total number of columns in the given table. */ - $updatedAt: string; + total: number; /** - * Collection permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * List of columns. */ - $permissions: string[]; + columns: (Models.ColumnBoolean | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail | Models.ColumnEnum | Models.ColumnUrl | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship | Models.ColumnPoint | Models.ColumnLine | Models.ColumnPolygon | Models.ColumnVarchar | Models.ColumnText | Models.ColumnMediumtext | Models.ColumnLongtext | Models.ColumnString)[]; + } + + /** + * Column Indexes List + */ + export type ColumnIndexList = { /** - * Database ID. + * Total number of indexes that matched your query. */ - databaseId: string; + total: number; /** - * Collection name. + * List of indexes. */ - name: string; + indexes: ColumnIndex[]; + } + + /** + * Console Variables + */ + export type ConsoleVariables = { /** - * Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys. + * CNAME target for your Appwrite custom domains. */ - enabled: boolean; + _APP_DOMAIN_TARGET_CNAME: string; /** - * Whether document-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). + * A target for your Appwrite custom domains. */ - documentSecurity: boolean; + _APP_DOMAIN_TARGET_A: string; /** - * Collection attributes. + * Maximum build timeout in seconds. */ - attributes: (Models.AttributeObject | Models.AttributeVector)[]; + _APP_COMPUTE_BUILD_TIMEOUT: number; /** - * Collection indexes. + * AAAA target for your Appwrite custom domains. */ - indexes: Index[]; + _APP_DOMAIN_TARGET_AAAA: string; /** - * Maximum document size in bytes. Returns 0 when no limit applies. + * CAA target for your Appwrite custom domains. */ - bytesMax: number; + _APP_DOMAIN_TARGET_CAA: string; /** - * Currently used document size in bytes based on defined attributes. + * Maximum file size allowed for file upload in bytes. */ - bytesUsed: number; + _APP_STORAGE_LIMIT: number; /** - * Embedding dimension. + * Maximum file size allowed for deployment in bytes. */ - dimension: number; - } - - /** - * AttributeObject - */ - export type AttributeObject = { + _APP_COMPUTE_SIZE_LIMIT: number; /** - * Attribute Key. + * Defines if usage stats are enabled. This value is set to 'enabled' by default, to disable the usage stats set the value to 'disabled'. */ - key: string; + _APP_USAGE_STATS: string; /** - * Attribute type. + * Defines if VCS (Version Control System) is enabled. */ - type: string; + _APP_VCS_ENABLED: boolean; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Defines if main domain is configured. If so, custom domains can be created. */ - status: AttributeStatus; + _APP_DOMAIN_ENABLED: boolean; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Defines if AI assistant is enabled. */ - error: string; + _APP_ASSISTANT_ENABLED: boolean; /** - * Is attribute required? + * A comma separated list of domains to use for site URLs. */ - required: boolean; + _APP_DOMAIN_SITES: string; /** - * Is attribute an array? + * A domain to use for function URLs. */ - array?: boolean; + _APP_DOMAIN_FUNCTIONS: string; /** - * Attribute creation date in ISO 8601 format. + * Defines if HTTPS is enforced for all requests. */ - $createdAt: string; + _APP_OPTIONS_FORCE_HTTPS: string; /** - * Attribute update date in ISO 8601 format. + * Comma-separated list of nameservers. */ - $updatedAt: string; + _APP_DOMAINS_NAMESERVERS: string; + /** + * Database adapter in use. + */ + _APP_DB_ADAPTER: string; + /** + * Whether the database adapter supports relationships. + */ + supportForRelationships: boolean; + /** + * Whether the database adapter supports operators. + */ + supportForOperators: boolean; + /** + * Whether the database adapter supports spatial attributes. + */ + supportForSpatials: boolean; + /** + * Whether the database adapter supports spatial indexes on nullable columns. + */ + supportForSpatialIndexNull: boolean; + /** + * Whether the database adapter supports fulltext wildcard search. + */ + supportForFulltextWildcard: boolean; + /** + * Whether the database adapter supports multiple fulltext indexes per collection. + */ + supportForMultipleFulltextIndexes: boolean; + /** + * Whether the database adapter supports resizing attributes. + */ + supportForAttributeResizing: boolean; + /** + * Whether the database adapter supports fixed schemas with row width limits. + */ + supportForSchemas: boolean; + /** + * Maximum index length supported by the database adapter. + */ + maxIndexLength: number; + /** + * Whether the database adapter uses integer sequence IDs. + */ + supportForIntegerIds: boolean; } /** - * AttributeVector + * Databases List */ - export type AttributeVector = { + export type DatabaseList = { /** - * Attribute Key. + * Total number of databases that matched your query. */ - key: string; + total: number; /** - * Attribute type. + * List of databases. */ - type: string; + databases: Database[]; + } + + /** + * Database + */ + export type Database = { /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Database ID. */ - status: AttributeStatus; + $id: string; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Database name. */ - error: string; + name: string; /** - * Is attribute required? + * Database creation date in ISO 8601 format. */ - required: boolean; + $createdAt: string; /** - * Is attribute an array? + * Database update date in ISO 8601 format. */ - array?: boolean; + $updatedAt: string; /** - * Attribute creation date in ISO 8601 format. + * If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys. + */ + enabled: boolean; + /** + * Database type. + */ + type: DatabaseType; + /** + * Database backup policies. + */ + policies: Index[]; + /** + * Database backup archives. + */ + archives: Collection[]; + } + + /** + * Transaction List + */ + export type TransactionList = { + /** + * Total number of transactions that matched your query. + */ + total: number; + /** + * List of transactions. + */ + transactions: Transaction[]; + } + + /** + * Transaction + */ + export type Transaction = { + /** + * Transaction ID. + */ + $id: string; + /** + * Transaction creation time in ISO 8601 format. */ $createdAt: string; /** - * Attribute update date in ISO 8601 format. + * Transaction update date in ISO 8601 format. */ $updatedAt: string; /** - * Vector dimensions. + * Current status of the transaction. One of: pending, committing, committed, rolled_back, failed. */ - size: number; + status: string; + /** + * Number of operations in the transaction. + */ + operations: number; + /** + * Expiration time in ISO 8601 format. + */ + expiresAt: string; } /** - * UsageVectorsDBs + * UsageDatabases */ - export type UsageVectorsDBs = { + export type UsageDatabases = { /** * Time range of the usage stats. */ range: string; /** - * Total aggregated number of VectorsDB databases. + * Total aggregated number of databases. */ databasesTotal: number; /** - * Total aggregated number of collections. + * Total aggregated number of collections. */ collectionsTotal: number; + /** + * Total aggregated number of tables. + */ + tablesTotal: number; /** * Total aggregated number of documents. */ documentsTotal: number; /** - * Total aggregated storage in bytes. + * Total aggregated number of rows. + */ + rowsTotal: number; + /** + * Total aggregated number of total databases storage in bytes. */ storageTotal: number; /** - * Total number of database reads. + * Total number of databases reads. */ databasesReadsTotal: number; /** - * Total number of database writes. + * Total number of databases writes. */ databasesWritesTotal: number; /** @@ -1936,12 +1835,20 @@ export namespace Models { * Aggregated number of collections per period. */ collections: Metric[]; + /** + * Aggregated number of tables per period. + */ + tables: Metric[]; /** * Aggregated number of documents per period. */ documents: Metric[]; /** - * Aggregated storage in bytes per period. + * Aggregated number of rows per period. + */ + rows: Metric[]; + /** + * An array of the aggregated number of databases storage in bytes per period. */ storage: Metric[]; /** @@ -1955,73 +1862,37 @@ export namespace Models { } /** - * UsageVectorsDB + * Collections List */ - export type UsageVectorsDB = { + export type CollectionList = { /** - * Time range of the usage stats. - */ - range: string; - /** - * Total aggregated number of collections. - */ - collectionsTotal: number; - /** - * Total aggregated number of documents. - */ - documentsTotal: number; - /** - * Total aggregated storage used in bytes. - */ - storageTotal: number; - /** - * Total number of database reads. - */ - databaseReadsTotal: number; - /** - * Total number of database writes. - */ - databaseWritesTotal: number; - /** - * Aggregated number of collections per period. - */ - collections: Metric[]; - /** - * Aggregated number of documents per period. - */ - documents: Metric[]; - /** - * Aggregated storage used in bytes per period. - */ - storage: Metric[]; - /** - * An array of aggregated number of database reads. + * Total number of collections that matched your query. */ - databaseReads: Metric[]; + total: number; /** - * An array of aggregated number of database writes. + * List of collections. */ - databaseWrites: Metric[]; + collections: Collection[]; } /** - * Table + * Collection */ - export type Table = { + export type Collection = { /** - * Table ID. + * Collection ID. */ $id: string; /** - * Table creation date in ISO 8601 format. + * Collection creation date in ISO 8601 format. */ $createdAt: string; /** - * Table update date in ISO 8601 format. + * Collection update date in ISO 8601 format. */ $updatedAt: string; /** - * Table permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * Collection permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ $permissions: string[]; /** @@ -2029,371 +1900,367 @@ export namespace Models { */ databaseId: string; /** - * Table name. + * Collection name. */ name: string; /** - * Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys. + * Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys. */ enabled: boolean; /** - * Whether row-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). + * Whether document-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). */ - rowSecurity: boolean; + documentSecurity: boolean; /** - * Table columns. + * Collection attributes. */ - columns: (Models.ColumnBoolean | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail | Models.ColumnEnum | Models.ColumnUrl | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship | Models.ColumnPoint | Models.ColumnLine | Models.ColumnPolygon | Models.ColumnVarchar | Models.ColumnText | Models.ColumnMediumtext | Models.ColumnLongtext | Models.ColumnString)[]; + attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributePoint | Models.AttributeLine | Models.AttributePolygon | Models.AttributeVarchar | Models.AttributeText | Models.AttributeMediumtext | Models.AttributeLongtext | Models.AttributeString)[]; /** - * Table indexes. + * Collection indexes. */ - indexes: ColumnIndex[]; + indexes: Index[]; /** - * Maximum row size in bytes. Returns 0 when no limit applies. + * Maximum document size in bytes. Returns 0 when no limit applies. */ bytesMax: number; /** - * Currently used row size in bytes based on defined columns. + * Currently used document size in bytes based on defined attributes. */ bytesUsed: number; } /** - * Columns List + * Attributes List */ - export type ColumnList = { + export type AttributeList = { /** - * Total number of columns in the given table. + * Total number of attributes in the given collection. */ total: number; /** - * List of columns. + * List of attributes. */ - columns: (Models.ColumnBoolean | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail | Models.ColumnEnum | Models.ColumnUrl | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship | Models.ColumnPoint | Models.ColumnLine | Models.ColumnPolygon | Models.ColumnVarchar | Models.ColumnText | Models.ColumnMediumtext | Models.ColumnLongtext | Models.ColumnString)[]; + attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributePoint | Models.AttributeLine | Models.AttributePolygon | Models.AttributeVarchar | Models.AttributeText | Models.AttributeMediumtext | Models.AttributeLongtext | Models.AttributeString)[]; } /** - * ColumnString + * AttributeBoolean */ - export type ColumnString = { + export type AttributeBoolean = { /** - * Column Key. + * Attribute Key. */ key: string; /** - * Column type. + * Attribute type. */ type: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: ColumnStatus; + status: AttributeStatus; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ error: string; /** - * Is column required? + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * Column size. - */ - size: number; - /** - * Default value for column when not provided. Cannot be set when column is required. - */ - default?: string; - /** - * Defines whether this column is encrypted or not. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - encrypt?: boolean; + default?: boolean; } /** - * ColumnInteger + * AttributeDatetime */ - export type ColumnInteger = { + export type AttributeDatetime = { /** - * Column Key. + * Attribute Key. */ key: string; /** - * Column type. + * Attribute type. */ type: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: ColumnStatus; + status: AttributeStatus; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ error: string; /** - * Is column required? + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * Minimum value to enforce for new documents. - */ - min?: number | bigint; - /** - * Maximum value to enforce for new documents. + * ISO 8601 format. */ - max?: number | bigint; + format: string; /** - * Default value for column when not provided. Cannot be set when column is required. + * Default value for attribute when not provided. Only null is optional */ - default?: number; + default?: string; } /** - * ColumnFloat + * AttributeEmail */ - export type ColumnFloat = { + export type AttributeEmail = { /** - * Column Key. + * Attribute Key. */ key: string; /** - * Column type. + * Attribute type. */ type: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: ColumnStatus; + status: AttributeStatus; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ error: string; /** - * Is column required? + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * Minimum value to enforce for new documents. - */ - min?: number; - /** - * Maximum value to enforce for new documents. + * String format. */ - max?: number; + format: string; /** - * Default value for column when not provided. Cannot be set when column is required. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: number; + default?: string; } /** - * ColumnBoolean + * AttributeEnum */ - export type ColumnBoolean = { + export type AttributeEnum = { /** - * Column Key. + * Attribute Key. */ key: string; /** - * Column type. + * Attribute type. */ type: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: ColumnStatus; + status: AttributeStatus; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ error: string; /** - * Is column required? + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * Default value for column when not provided. Cannot be set when column is required. + * Array of elements in enumerated type. */ - default?: boolean; + elements: string[]; + /** + * String format. + */ + format: string; + /** + * Default value for attribute when not provided. Cannot be set when attribute is required. + */ + default?: string; } /** - * ColumnEmail + * AttributeFloat */ - export type ColumnEmail = { + export type AttributeFloat = { /** - * Column Key. + * Attribute Key. */ key: string; /** - * Column type. + * Attribute type. */ type: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: ColumnStatus; + status: AttributeStatus; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ error: string; /** - * Is column required? + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * String format. + * Minimum value to enforce for new documents. */ - format: string; + min?: number; /** - * Default value for column when not provided. Cannot be set when column is required. + * Maximum value to enforce for new documents. */ - default?: string; + max?: number; + /** + * Default value for attribute when not provided. Cannot be set when attribute is required. + */ + default?: number; } /** - * ColumnEnum + * AttributeInteger */ - export type ColumnEnum = { + export type AttributeInteger = { /** - * Column Key. + * Attribute Key. */ key: string; /** - * Column type. + * Attribute type. */ type: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: ColumnStatus; + status: AttributeStatus; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ error: string; /** - * Is column required? + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * Array of elements in enumerated type. + * Minimum value to enforce for new documents. */ - elements: string[]; + min?: number | bigint; /** - * String format. + * Maximum value to enforce for new documents. */ - format: string; + max?: number | bigint; /** - * Default value for column when not provided. Cannot be set when column is required. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: string; + default?: number; } /** - * ColumnIP + * AttributeIP */ - export type ColumnIp = { + export type AttributeIp = { /** - * Column Key. + * Attribute Key. */ key: string; /** - * Column type. + * Attribute type. */ type: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: ColumnStatus; + status: AttributeStatus; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ error: string; /** - * Is column required? + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** @@ -2401,529 +2268,554 @@ export namespace Models { */ format: string; /** - * Default value for column when not provided. Cannot be set when column is required. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ default?: string; } /** - * ColumnURL + * AttributeLine */ - export type ColumnUrl = { + export type AttributeLine = { /** - * Column Key. + * Attribute Key. */ key: string; /** - * Column type. + * Attribute type. */ type: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: ColumnStatus; + status: AttributeStatus; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ error: string; /** - * Is column required? + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * String format. - */ - format: string; - /** - * Default value for column when not provided. Cannot be set when column is required. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: string; + default?: any[]; } /** - * ColumnDatetime + * AttributeLongtext */ - export type ColumnDatetime = { + export type AttributeLongtext = { /** - * Column Key. + * Attribute Key. */ key: string; /** - * Column type. + * Attribute type. */ type: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: ColumnStatus; + status: AttributeStatus; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ error: string; /** - * Is column required? + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * ISO 8601 format. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - format: string; + default?: string; /** - * Default value for column when not provided. Only null is optional + * Defines whether this attribute is encrypted or not. */ - default?: string; + encrypt?: boolean; } /** - * ColumnRelationship + * AttributeMediumtext */ - export type ColumnRelationship = { + export type AttributeMediumtext = { /** - * Column Key. + * Attribute Key. */ key: string; /** - * Column type. + * Attribute type. */ type: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: ColumnStatus; + status: AttributeStatus; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ error: string; /** - * Is column required? + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * The ID of the related table. - */ - relatedTable: string; - /** - * The type of the relationship. - */ - relationType: string; - /** - * Is the relationship two-way? - */ - twoWay: boolean; - /** - * The key of the two-way relationship. - */ - twoWayKey: string; - /** - * How deleting the parent document will propagate to child documents. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - onDelete: string; + default?: string; /** - * Whether this is the parent or child side of the relationship + * Defines whether this attribute is encrypted or not. */ - side: string; + encrypt?: boolean; } /** - * ColumnPoint + * AttributePoint */ - export type ColumnPoint = { + export type AttributePoint = { /** - * Column Key. + * Attribute Key. */ key: string; /** - * Column type. + * Attribute type. */ type: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: ColumnStatus; + status: AttributeStatus; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ error: string; /** - * Is column required? + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * Default value for column when not provided. Cannot be set when column is required. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ default?: any[]; } /** - * ColumnLine + * AttributePolygon */ - export type ColumnLine = { + export type AttributePolygon = { /** - * Column Key. + * Attribute Key. */ key: string; /** - * Column type. + * Attribute type. */ type: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: ColumnStatus; + status: AttributeStatus; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ error: string; /** - * Is column required? + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * Default value for column when not provided. Cannot be set when column is required. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ default?: any[]; } /** - * ColumnPolygon + * AttributeRelationship */ - export type ColumnPolygon = { + export type AttributeRelationship = { /** - * Column Key. + * Attribute Key. */ key: string; /** - * Column type. + * Attribute type. */ type: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: ColumnStatus; + status: AttributeStatus; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ error: string; /** - * Is column required? + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * Default value for column when not provided. Cannot be set when column is required. + * The ID of the related collection. */ - default?: any[]; - } - - /** - * ColumnVarchar - */ - export type ColumnVarchar = { + relatedCollection: string; /** - * Column Key. + * The type of the relationship. */ - key: string; + relationType: string; /** - * Column type. + * Is the relationship two-way? */ - type: string; + twoWay: boolean; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * The key of the two-way relationship. */ - status: ColumnStatus; + twoWayKey: string; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * How deleting the parent document will propagate to child documents. */ - error: string; + onDelete: string; /** - * Is column required? + * Whether this is the parent or child side of the relationship + */ + side: string; + } + + /** + * AttributeString + */ + export type AttributeString = { + /** + * Attribute Key. + */ + key: string; + /** + * Attribute type. + */ + type: string; + /** + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: AttributeStatus; + /** + * Error message. Displays error generated on failure of creating or deleting an attribute. + */ + error: string; + /** + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * Column size. + * Attribute size. */ size: number; /** - * Default value for column when not provided. Cannot be set when column is required. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ default?: string; /** - * Defines whether this column is encrypted or not. + * Defines whether this attribute is encrypted or not. */ encrypt?: boolean; } /** - * ColumnText + * AttributeText */ - export type ColumnText = { + export type AttributeText = { /** - * Column Key. + * Attribute Key. */ key: string; /** - * Column type. + * Attribute type. */ type: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: ColumnStatus; + status: AttributeStatus; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ error: string; /** - * Is column required? + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * Default value for column when not provided. Cannot be set when column is required. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ default?: string; /** - * Defines whether this column is encrypted or not. + * Defines whether this attribute is encrypted or not. */ encrypt?: boolean; } /** - * ColumnMediumtext + * AttributeURL */ - export type ColumnMediumtext = { + export type AttributeUrl = { /** - * Column Key. + * Attribute Key. */ key: string; /** - * Column type. + * Attribute type. */ type: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: ColumnStatus; + status: AttributeStatus; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ error: string; /** - * Is column required? + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * Default value for column when not provided. Cannot be set when column is required. + * String format. */ - default?: string; + format: string; /** - * Defines whether this column is encrypted or not. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - encrypt?: boolean; + default?: string; } /** - * ColumnLongtext + * AttributeVarchar */ - export type ColumnLongtext = { + export type AttributeVarchar = { /** - * Column Key. + * Attribute Key. */ key: string; /** - * Column type. + * Attribute type. */ type: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: ColumnStatus; + status: AttributeStatus; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ error: string; /** - * Is column required? + * Is attribute required? */ required: boolean; /** - * Is column an array? + * Is attribute an array? */ array?: boolean; /** - * Column creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * Default value for column when not provided. Cannot be set when column is required. + * Attribute size. + */ + size: number; + /** + * Default value for attribute when not provided. Cannot be set when attribute is required. */ default?: string; /** - * Defines whether this column is encrypted or not. + * Defines whether this attribute is encrypted or not. */ encrypt?: boolean; } /** - * Index + * Documents List */ - export type Index = { + export type DocumentList = { /** - * Index ID. + * Total number of documents that matched your query. */ - $id: string; + total: number; /** - * Index creation date in ISO 8601 format. + * List of documents. */ - $createdAt: string; + documents: Document[]; + } + + /** + * Document + */ + export type Document = { /** - * Index update date in ISO 8601 format. + * Document ID. */ - $updatedAt: string; + $id: string; /** - * Index key. + * Document sequence ID. */ - key: string; + $sequence: string; /** - * Index type. + * Collection ID. */ - type: string; + $collectionId: string; /** - * Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Database ID. */ - status: IndexStatus; + $databaseId: string; /** - * Error message. Displays error generated on failure of creating or deleting an index. + * Document creation date in ISO 8601 format. */ - error: string; + $createdAt: string; /** - * Index attributes. + * Document update date in ISO 8601 format. */ - attributes: string[]; + $updatedAt: string; /** - * Index attributes length. + * Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ - lengths: number[]; + $permissions: string[]; + } + + export type DefaultDocument = Document & { + [key: string]: any; + [__default]: true; + }; + + /** + * Indexes List + */ + export type IndexList = { /** - * Index orders. + * Total number of indexes that matched your query. */ - orders?: string[]; + total: number; + /** + * List of indexes. + */ + indexes: Index[]; } /** * Index */ - export type ColumnIndex = { + export type Index = { /** * Index ID. */ @@ -2937,7 +2829,7 @@ export namespace Models { */ $updatedAt: string; /** - * Index Key. + * Index key. */ key: string; /** @@ -2947,17 +2839,17 @@ export namespace Models { /** * Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: string; + status: IndexStatus; /** * Error message. Displays error generated on failure of creating or deleting an index. */ error: string; /** - * Index columns. + * Index attributes. */ - columns: string[]; + attributes: string[]; /** - * Index columns length. + * Index attributes length. */ lengths: number[]; /** @@ -2967,772 +2859,743 @@ export namespace Models { } /** - * Row + * UsageCollection */ - export type Row = { - /** - * Row ID. - */ - $id: string; - /** - * Row sequence ID. - */ - $sequence: string; - /** - * Table ID. - */ - $tableId: string; - /** - * Database ID. - */ - $databaseId: string; + export type UsageCollection = { /** - * Row creation date in ISO 8601 format. + * Time range of the usage stats. */ - $createdAt: string; + range: string; /** - * Row update date in ISO 8601 format. + * Total aggregated number of of documents. */ - $updatedAt: string; + documentsTotal: number; /** - * Row permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * Aggregated number of documents per period. */ - $permissions: string[]; + documents: Metric[]; } - export type DefaultRow = Row & { - [key: string]: any; - [__default]: true; - }; - /** - * Document + * UsageDatabase */ - export type Document = { + export type UsageDatabase = { /** - * Document ID. + * Time range of the usage stats. */ - $id: string; + range: string; /** - * Document sequence ID. + * Total aggregated number of collections. */ - $sequence: string; + collectionsTotal: number; /** - * Collection ID. + * Total aggregated number of tables. */ - $collectionId: string; - /** - * Database ID. - */ - $databaseId: string; + tablesTotal: number; /** - * Document creation date in ISO 8601 format. + * Total aggregated number of documents. */ - $createdAt: string; + documentsTotal: number; /** - * Document update date in ISO 8601 format. + * Total aggregated number of rows. */ - $updatedAt: string; + rowsTotal: number; /** - * Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * Total aggregated number of total storage used in bytes. */ - $permissions: string[]; - } - - export type DefaultDocument = Document & { - [key: string]: any; - [__default]: true; - }; - - /** - * Log - */ - export type Log = { + storageTotal: number; /** - * Event name. + * Total number of databases reads. */ - event: string; + databaseReadsTotal: number; /** - * User ID of the actor recorded for this log. During impersonation, this is the original impersonator, not the impersonated target user. + * Total number of databases writes. */ - userId: string; + databaseWritesTotal: number; /** - * User email of the actor recorded for this log. During impersonation, this is the original impersonator. + * Aggregated number of collections per period. */ - userEmail: string; + collections: Metric[]; /** - * User name of the actor recorded for this log. During impersonation, this is the original impersonator. + * Aggregated number of tables per period. */ - userName: string; + tables: Metric[]; /** - * API mode when event triggered. + * Aggregated number of documents per period. */ - mode: string; + documents: Metric[]; /** - * IP session in use when the session was created. + * Aggregated number of rows per period. */ - ip: string; + rows: Metric[]; /** - * Log creation date in ISO 8601 format. + * Aggregated storage used in bytes per period. */ - time: string; + storage: Metric[]; /** - * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). + * An array of aggregated number of database reads. */ - osCode: string; + databaseReads: Metric[]; /** - * Operating system name. + * An array of aggregated number of database writes. */ - osName: string; + databaseWrites: Metric[]; + } + + /** + * Domains list + */ + export type DomainsList = { /** - * Operating system version. + * Total number of domains that matched your query. */ - osVersion: string; + total: number; /** - * Client type. + * List of domains. */ - clientType: string; + domains: Domain[]; + } + + /** + * Domain + */ + export type Domain = { /** - * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). + * Domain ID. */ - clientCode: string; + $id: string; /** - * Client name. + * Domain creation time in ISO 8601 format. */ - clientName: string; + $createdAt: string; /** - * Client version. + * Domain update date in ISO 8601 format. */ - clientVersion: string; + $updatedAt: string; /** - * Client engine name. + * Domain name. */ - clientEngine: string; + domain: string; /** - * Client engine name. + * Domain registrar (e.g. "appwrite" or "third_party"). */ - clientEngineVersion: string; + registrar: string; /** - * Device name. + * Nameservers setting. "Appwrite" or empty string. */ - deviceName: string; + nameservers: string; /** - * Device brand name. + * Domain expiry date in ISO 8601 format. */ - deviceBrand: string; + expire: string; /** - * Device model name. + * Domain renewal date in ISO 8601 format. */ - deviceModel: string; + renewal: string; /** - * Country two-character ISO 3166-1 alpha code. + * If set to true, the domain will automatically renew. */ - countryCode: string; + autoRenewal: boolean; /** - * Country name. + * Renewal price (in cents). */ - countryName: string; - } - - /** - * User - */ - export type User = { + renewalPrice: number; /** - * User ID. + * Transfer status for domains being transferred in. */ - $id: string; + transferStatus: DomainTransferStatusEnum; /** - * User creation date in ISO 8601 format. + * Team ID. */ - $createdAt: string; + teamId: string; /** - * User update date in ISO 8601 format. + * Dns records */ - $updatedAt: string; + dnsRecords: DnsRecord[]; + } + + /** + * DomainPrice + */ + export type DomainPrice = { /** - * User name. + * Domain name. */ - name: string; + domain: string; /** - * Hashed user password. + * Top-level domain for the requested domain. */ - password?: string; + tld: string; /** - * Password hashing algorithm. + * Whether the domain is currently available for registration. */ - hash?: string; + available: boolean; /** - * Password hashing algorithm configuration. + * Domain registration price. */ - hashOptions?: object; + price: number; /** - * User registration date in ISO 8601 format. + * Price period in years. */ - registration: string; + periodYears: number; /** - * User status. Pass `true` for enabled and `false` for disabled. + * Whether the domain is a premium domain. */ - status: boolean; + premium: boolean; + } + + /** + * DomainPurchase + */ + export type DomainPurchase = { /** - * Labels for the user. + * Purchase/invoice ID. */ - labels: string[]; + $id: string; /** - * Password update time in ISO 8601 format. + * Purchase creation time in ISO 8601 format. */ - passwordUpdate: string; + $createdAt: string; /** - * User email address. + * Purchase update date in ISO 8601 format. */ - email: string; + $updatedAt: string; /** - * User phone number in E.164 format. + * Domain document ID. */ - phone: string; + domainId: string; /** - * Email verification status. + * Domain name. */ - emailVerification: boolean; + domain: string; /** - * Phone verification status. + * Team ID that owns the domain. */ - phoneVerification: boolean; + organizationId: string; /** - * Multi factor authentication status. + * Domain purchase status. */ - mfa: boolean; + status: DomainPurchaseStatus; /** - * User preferences as a key-value object + * Stripe client secret for 3DS; empty when not applicable. */ - prefs: Preferences; + clientSecret: string; /** - * A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider. + * Purchase amount. */ - targets: Target[]; + amount: number; /** - * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + * Currency code. */ - accessedAt: string; + currency: string; + } + + /** + * Domain suggestions list + */ + export type DomainSuggestionsList = { /** - * Whether the user can impersonate other users. + * Total number of suggestions that matched your query. */ - impersonator?: boolean; + total: number; /** - * ID of the original actor performing the impersonation. Present only when the current request is impersonating another user. Internal audit logs attribute the action to this user, while the impersonated target is recorded only in internal audit payload data. + * List of suggestions. */ - impersonatorUserId?: string; + suggestions: DomainSuggestion[]; } /** - * AlgoMD5 + * domainTransferOut */ - export type AlgoMd5 = { + export type DomainTransferOut = { /** - * Algo type. + * Domain transfer authorization code. */ - type: string; + authCode: string; } /** - * AlgoSHA + * DNS records list */ - export type AlgoSha = { + export type DnsRecordsList = { /** - * Algo type. + * Total number of dnsRecords that matched your query. */ - type: string; + total: number; + /** + * List of dnsRecords. + */ + dnsRecords: DnsRecord[]; } /** - * AlgoPHPass + * DNSRecord */ - export type AlgoPhpass = { + export type DnsRecord = { /** - * Algo type. + * DNS Record ID. */ - type: string; - } - - /** - * AlgoBcrypt - */ - export type AlgoBcrypt = { + $id: string; /** - * Algo type. + * DNS Record creation time in ISO 8601 format. */ - type: string; - } - - /** - * AlgoScrypt - */ - export type AlgoScrypt = { + $createdAt: string; /** - * Algo type. + * DNS Record update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * DNS record type (e.g. A, CNAME, MX). */ type: string; /** - * CPU complexity of computed hash. + * Record name or subdomain. */ - costCpu: number; + name: string; /** - * Memory complexity of computed hash. + * Value of the record (IP address, domain, etc.). */ - costMemory: number; + value: string; /** - * Parallelization of computed hash. + * Time to live (in seconds). */ - costParallel: number; + ttl: number; /** - * Length used to compute hash. + * Record priority (commonly used for MX). */ - length: number; - } - - /** - * AlgoScryptModified - */ - export type AlgoScryptModified = { + priority: number; /** - * Algo type. + * Whether this record is locked (read-only). */ - type: string; + lock: boolean; /** - * Salt used to compute hash. + * Record weight (used for SRV records). */ - salt: string; + weight: number; /** - * Separator used to compute hash. + * Target port (used for SRV records). */ - saltSeparator: string; + port: number; /** - * Key used to compute hash. + * Comment for the DNS record. */ - signerKey: string; + comment: string; } /** - * AlgoArgon2 + * domainTransferStatus */ - export type AlgoArgon2 = { - /** - * Algo type. - */ - type: string; + export type DomainTransferStatus = { /** - * Memory used to compute hash. + * Transfer status. */ - memoryCost: number; + status: DomainTransferStatusEnum; /** - * Amount of time consumed to compute hash + * Additional transfer status information. */ - timeCost: number; + reason: string; /** - * Number of threads used to compute hash. + * Transfer status timestamp in ISO 8601 format. */ - threads: number; + timestamp: string; } /** - * Preferences + * Functions List */ - export type Preferences = { + export type FunctionList = { + /** + * Total number of functions that matched your query. + */ + total: number; + /** + * List of functions. + */ + functions: Function[]; } - export type DefaultPreferences = Preferences & { - [key: string]: any; - [__default]: true; - }; - /** - * Session + * Function */ - export type Session = { + export type Function = { /** - * Session ID. + * Function ID. */ $id: string; /** - * Session creation date in ISO 8601 format. + * Function creation date in ISO 8601 format. */ $createdAt: string; /** - * Session update date in ISO 8601 format. + * Function update date in ISO 8601 format. */ $updatedAt: string; /** - * User ID. + * Execution permissions. */ - userId: string; + execute: string[]; /** - * Session expiration date in ISO 8601 format. + * Function name. */ - expire: string; + name: string; /** - * Session Provider. + * Function enabled. */ - provider: string; + enabled: boolean; /** - * Session Provider User ID. + * Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration. */ - providerUid: string; + live: boolean; /** - * Session Provider Access Token. + * When disabled, executions will exclude logs and errors, and will be slightly faster. */ - providerAccessToken: string; + logging: boolean; /** - * The date of when the access token expires in ISO 8601 format. + * Function execution and build runtime. */ - providerAccessTokenExpiry: string; + runtime: string; /** - * Session Provider Refresh Token. + * How many days to keep the non-active deployments before they will be automatically deleted. */ - providerRefreshToken: string; + deploymentRetention: number; /** - * IP in use when the session was created. + * Function's active deployment ID. */ - ip: string; + deploymentId: string; /** - * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). + * Active deployment creation date in ISO 8601 format. */ - osCode: string; + deploymentCreatedAt: string; /** - * Operating system name. + * Function's latest deployment ID. */ - osName: string; + latestDeploymentId: string; /** - * Operating system version. + * Latest deployment creation date in ISO 8601 format. */ - osVersion: string; + latestDeploymentCreatedAt: string; /** - * Client type. + * Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed". */ - clientType: string; + latestDeploymentStatus: string; /** - * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). + * Allowed permission scopes. */ - clientCode: string; + scopes: string[]; /** - * Client name. + * Function variables. */ - clientName: string; + vars: Variable[]; /** - * Client version. + * Function trigger events. */ - clientVersion: string; + events: string[]; /** - * Client engine name. + * Function execution schedule in CRON format. */ - clientEngine: string; + schedule: string; /** - * Client engine name. + * Function execution timeout in seconds. */ - clientEngineVersion: string; + timeout: number; /** - * Device name. + * The entrypoint file used to execute the deployment. */ - deviceName: string; + entrypoint: string; /** - * Device brand name. + * The build command used to build the deployment. */ - deviceBrand: string; + commands: string; /** - * Device model name. + * Version of Open Runtimes used for the function. */ - deviceModel: string; + version: string; /** - * Country two-character ISO 3166-1 alpha code. + * Function VCS (Version Control System) installation id. */ - countryCode: string; + installationId: string; /** - * Country name. + * VCS (Version Control System) Repository ID */ - countryName: string; + providerRepositoryId: string; /** - * Returns true if this the current user session. + * VCS (Version Control System) branch name */ - current: boolean; + providerBranch: string; /** - * Returns a list of active session factors. + * Path to function in VCS (Version Control System) repository */ - factors: string[]; + providerRootDirectory: string; /** - * Secret used to authenticate the user. Only included if the request was made with an API key + * 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 */ - secret: string; + providerSilentMode: boolean; /** - * Most recent date in ISO 8601 format when the session successfully passed MFA challenge. + * Machine specification for deployment builds. */ - mfaUpdatedAt: string; + buildSpecification: string; + /** + * Machine specification for executions. + */ + runtimeSpecification: string; } /** - * Identity + * Runtimes List */ - export type Identity = { + export type RuntimeList = { /** - * Identity ID. + * Total number of runtimes that matched your query. */ - $id: string; + total: number; /** - * Identity creation date in ISO 8601 format. + * List of runtimes. */ - $createdAt: string; + runtimes: Runtime[]; + } + + /** + * Specifications List + */ + export type SpecificationList = { /** - * Identity update date in ISO 8601 format. + * Total number of specifications that matched your query. */ - $updatedAt: string; + total: number; /** - * User ID. + * List of specifications. */ - userId: string; + specifications: Specification[]; + } + + /** + * Function Templates List + */ + export type TemplateFunctionList = { /** - * Identity Provider. + * Total number of templates that matched your query. */ - provider: string; + total: number; /** - * ID of the User in the Identity Provider. - */ - providerUid: string; - /** - * Email of the User in the Identity Provider. - */ - providerEmail: string; - /** - * Identity Provider Access Token. - */ - providerAccessToken: string; - /** - * The date of when the access token expires in ISO 8601 format. - */ - providerAccessTokenExpiry: string; - /** - * Identity Provider Refresh Token. + * List of templates. */ - providerRefreshToken: string; + templates: TemplateFunction[]; } /** - * Token + * Template Function */ - export type Token = { + export type TemplateFunction = { /** - * Token ID. + * Function Template Icon. */ - $id: string; + icon: string; /** - * Token creation date in ISO 8601 format. + * Function Template ID. */ - $createdAt: string; + id: string; /** - * User ID. + * Function Template Name. */ - userId: string; + name: string; /** - * Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. + * Function Template Tagline. */ - secret: string; + tagline: string; /** - * Token expiration date in ISO 8601 format. + * Execution permissions. */ - expire: string; + permissions: string[]; /** - * Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email. + * Function trigger events. */ - phrase: string; - } - - /** - * JWT - */ - export type Jwt = { + events: string[]; /** - * JWT encoded string. + * Function execution schedult in CRON format. */ - jwt: string; - } - - /** - * Locale - */ - export type Locale = { + cron: string; /** - * User IP address. + * Function execution timeout in seconds. */ - ip: string; + timeout: number; /** - * Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format + * Function use cases. */ - countryCode: string; + useCases: string[]; /** - * Country name. This field support localization. + * List of runtimes that can be used with this template. */ - country: string; + runtimes: TemplateRuntime[]; /** - * Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America. + * Function Template Instructions. */ - continentCode: string; + instructions: string; /** - * Continent name. This field support localization. + * VCS (Version Control System) Provider. */ - continent: string; + vcsProvider: string; /** - * True if country is part of the European Union. + * VCS (Version Control System) Repository ID */ - eu: boolean; + providerRepositoryId: string; /** - * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format + * VCS (Version Control System) Owner. */ - currency: string; - } - - /** - * LocaleCode - */ - export type LocaleCode = { + providerOwner: string; /** - * Locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) + * VCS (Version Control System) branch version (tag). */ - code: string; + providerVersion: string; /** - * Locale name + * Function variables. */ - name: string; + variables: TemplateVariable[]; + /** + * Function scopes. + */ + scopes: string[]; } /** - * File + * UsageFunctions */ - export type File = { + export type UsageFunctions = { /** - * File ID. + * Time range of the usage stats. */ - $id: string; + range: string; /** - * Bucket ID. + * Total aggregated number of functions. */ - bucketId: string; + functionsTotal: number; /** - * File creation date in ISO 8601 format. + * Total aggregated number of functions deployments. */ - $createdAt: string; + deploymentsTotal: number; /** - * File update date in ISO 8601 format. + * Total aggregated sum of functions deployment storage. */ - $updatedAt: string; + deploymentsStorageTotal: number; /** - * File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * Total aggregated number of functions build. */ - $permissions: string[]; + buildsTotal: number; /** - * File name. + * total aggregated sum of functions build storage. */ - name: string; + buildsStorageTotal: number; /** - * File MD5 signature. + * Total aggregated sum of functions build compute time. */ - signature: string; + buildsTimeTotal: number; /** - * File mime type. + * Total aggregated sum of functions build mbSeconds. */ - mimeType: string; + buildsMbSecondsTotal: number; /** - * File original size in bytes. + * Total aggregated number of functions execution. */ - sizeOriginal: number; + executionsTotal: number; /** - * Total number of chunks available + * Total aggregated sum of functions execution compute time. */ - chunksTotal: number; + executionsTimeTotal: number; /** - * Total number of chunks uploaded + * Total aggregated sum of functions execution mbSeconds. */ - chunksUploaded: number; + executionsMbSecondsTotal: number; /** - * Whether file contents are encrypted at rest. + * Aggregated number of functions per period. */ - encryption: boolean; + functions: Metric[]; /** - * Compression algorithm used for the file. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd). + * Aggregated number of functions deployment per period. */ - compression: string; - } - - /** - * Bucket - */ - export type Bucket = { + deployments: Metric[]; /** - * Bucket ID. + * Aggregated number of functions deployment storage per period. */ - $id: string; + deploymentsStorage: Metric[]; /** - * Bucket creation time in ISO 8601 format. + * Total aggregated number of successful function builds. */ - $createdAt: string; + buildsSuccessTotal: number; /** - * Bucket update date in ISO 8601 format. + * Total aggregated number of failed function builds. */ - $updatedAt: string; + buildsFailedTotal: number; /** - * Bucket permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * Aggregated number of functions build per period. */ - $permissions: string[]; + builds: Metric[]; /** - * Whether file-level security is enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). + * Aggregated sum of functions build storage per period. */ - fileSecurity: boolean; + buildsStorage: Metric[]; /** - * Bucket name. + * Aggregated sum of functions build compute time per period. */ - name: string; + buildsTime: Metric[]; /** - * Bucket enabled. + * Aggregated sum of functions build mbSeconds per period. */ - enabled: boolean; + buildsMbSeconds: Metric[]; /** - * Maximum file size supported. + * Aggregated number of functions execution per period. */ - maximumFileSize: number; + executions: Metric[]; /** - * Allowed file extensions. + * Aggregated number of functions execution compute time per period. */ - allowedFileExtensions: string[]; + executionsTime: Metric[]; /** - * Compression algorithm chosen for compression. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd). + * Aggregated number of functions mbSeconds per period. */ - compression: string; + executionsMbSeconds: Metric[]; /** - * Bucket is encrypted. + * Aggregated number of successful function builds per period. */ - encryption: boolean; + buildsSuccess: Metric[]; /** - * Virus scanning is enabled. + * Aggregated number of failed function builds per period. */ - antivirus: boolean; + buildsFailed: Metric[]; + } + + /** + * Deployments List + */ + export type DeploymentList = { /** - * Image transformations are enabled. + * Total number of deployments that matched your query. */ - transformations: boolean; + total: number; /** - * Total size of this bucket in bytes. + * List of deployments. */ - totalSize: number; + deployments: Deployment[]; } /** - * ResourceToken + * Deployment */ - export type ResourceToken = { + export type Deployment = { /** - * Token ID. + * Deployment ID. */ $id: string; /** - * Token creation date in ISO 8601 format. + * Deployment creation date in ISO 8601 format. */ $createdAt: string; + /** + * Deployment update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Type of deployment. + */ + type: string; /** * Resource ID. */ @@ -3742,2987 +3605,2389 @@ export namespace Models { */ resourceType: string; /** - * Token expiration date in ISO 8601 format. + * The entrypoint file to use to execute the deployment code. */ - expire: string; + entrypoint: string; /** - * JWT encoded string. + * The code size in bytes. */ - secret: string; + sourceSize: number; /** - * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + * The build output size in bytes. */ - accessedAt: string; - } - - /** - * Team - */ - export type Team = { + buildSize: number; /** - * Team ID. + * The total size in bytes (source and build output). */ - $id: string; + totalSize: number; /** - * Team creation date in ISO 8601 format. + * The current build ID. */ - $createdAt: string; + buildId: string; /** - * Team update date in ISO 8601 format. + * Whether the deployment should be automatically activated. */ - $updatedAt: string; + activate: boolean; /** - * Team name. + * Screenshot with light theme preference file ID. */ - name: string; + screenshotLight: string; /** - * Total number of team members. + * Screenshot with dark theme preference file ID. */ - total: number; + screenshotDark: string; /** - * Team preferences as a key-value object + * The deployment status. Possible values are "waiting", "processing", "building", "ready", "canceled" and "failed". */ - prefs: Preferences; - } - - /** - * Membership - */ - export type Membership = { + status: DeploymentStatus; /** - * Membership ID. + * The build logs. */ - $id: string; + buildLogs: string; /** - * Membership creation date in ISO 8601 format. + * The current build time in seconds. */ - $createdAt: string; + buildDuration: number; /** - * Membership update date in ISO 8601 format. + * The name of the vcs provider repository */ - $updatedAt: string; + providerRepositoryName: string; /** - * User ID. + * The name of the vcs provider repository owner */ - userId: string; + providerRepositoryOwner: string; /** - * User name. Hide this attribute by toggling membership privacy in the Console. + * The url of the vcs provider repository */ - userName: string; + providerRepositoryUrl: string; /** - * User email address. Hide this attribute by toggling membership privacy in the Console. + * The commit hash of the vcs commit */ - userEmail: string; + providerCommitHash: string; /** - * Team ID. + * The url of vcs commit author */ - teamId: string; + providerCommitAuthorUrl: string; /** - * Team name. + * The name of vcs commit author */ - teamName: string; + providerCommitAuthor: string; /** - * Date, the user has been invited to join the team in ISO 8601 format. + * The commit message */ - invited: string; + providerCommitMessage: string; /** - * Date, the user has accepted the invitation to join the team in ISO 8601 format. + * The url of the vcs commit */ - joined: string; + providerCommitUrl: string; /** - * User confirmation status, true if the user has joined the team or false otherwise. + * The branch of the vcs repository */ - confirm: boolean; + providerBranch: string; /** - * Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console. + * The branch of the vcs repository */ - mfa: boolean; + providerBranchUrl: string; + } + + /** + * Executions List + */ + export type ExecutionList = { /** - * User list of roles + * Total number of executions that matched your query. */ - roles: string[]; + total: number; + /** + * List of executions. + */ + executions: Execution[]; } /** - * Site + * Execution */ - export type Site = { + export type Execution = { /** - * Site ID. + * Execution ID. */ $id: string; /** - * Site creation date in ISO 8601 format. + * Execution creation date in ISO 8601 format. */ $createdAt: string; /** - * Site update date in ISO 8601 format. + * Execution update date in ISO 8601 format. */ $updatedAt: string; /** - * Site name. + * Execution roles. */ - name: string; + $permissions: string[]; /** - * Site enabled. + * Function ID. */ - enabled: boolean; + functionId: string; /** - * Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration. + * Function's deployment ID used to create the execution. */ - live: boolean; + deploymentId: string; /** - * When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. + * The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`. */ - logging: boolean; + trigger: ExecutionTrigger; /** - * Site framework. + * The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, `failed`, or `scheduled`. */ - framework: string; + status: ExecutionStatus; /** - * How many days to keep the non-active deployments before they will be automatically deleted. + * HTTP request method type. */ - deploymentRetention: number; + requestMethod: string; /** - * Site's active deployment ID. + * HTTP request path and query. */ - deploymentId: string; + requestPath: string; /** - * Active deployment creation date in ISO 8601 format. + * HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. */ - deploymentCreatedAt: string; + requestHeaders: Headers[]; /** - * Screenshot of active deployment with light theme preference file ID. + * HTTP response status code. */ - deploymentScreenshotLight: string; + responseStatusCode: number; /** - * Screenshot of active deployment with dark theme preference file ID. + * HTTP response body. This will return empty unless execution is created as synchronous. */ - deploymentScreenshotDark: string; + responseBody: string; /** - * Site's latest deployment ID. + * HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. */ - latestDeploymentId: string; + responseHeaders: Headers[]; /** - * Latest deployment creation date in ISO 8601 format. + * Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. */ - latestDeploymentCreatedAt: string; + logs: string; /** - * Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed". + * Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. */ - latestDeploymentStatus: string; + errors: string; /** - * Site variables. + * Resource(function/site) execution duration in seconds. */ - vars: Variable[]; + duration: number; /** - * Site request timeout in seconds. + * The scheduled time for execution. If left empty, execution will be queued immediately. */ - timeout: number; + scheduledAt?: string; + } + + /** + * UsageFunction + */ + export type UsageFunction = { /** - * The install command used to install the site dependencies. + * The time range of the usage stats. */ - installCommand: string; + range: string; /** - * The build command used to build the site. + * Total aggregated number of function deployments. */ - buildCommand: string; + deploymentsTotal: number; /** - * Custom command to use when starting site runtime. + * Total aggregated sum of function deployments storage. */ - startCommand: string; + deploymentsStorageTotal: number; /** - * The directory where the site build output is located. + * Total aggregated number of function builds. */ - outputDirectory: string; + buildsTotal: number; /** - * Site VCS (Version Control System) installation id. + * Total aggregated number of successful function builds. */ - installationId: string; + buildsSuccessTotal: number; /** - * VCS (Version Control System) Repository ID + * Total aggregated number of failed function builds. */ - providerRepositoryId: string; + buildsFailedTotal: number; /** - * VCS (Version Control System) branch name + * total aggregated sum of function builds storage. */ - providerBranch: string; + buildsStorageTotal: number; /** - * Path to site in VCS (Version Control System) repository + * Total aggregated sum of function builds compute time. */ - providerRootDirectory: string; + buildsTimeTotal: number; /** - * 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 + * Average builds compute time. */ - providerSilentMode: boolean; + buildsTimeAverage: number; /** - * Machine specification for deployment builds. + * Total aggregated sum of function builds mbSeconds. */ - buildSpecification: string; + buildsMbSecondsTotal: number; /** - * Machine specification for SSR executions. + * Total aggregated number of function executions. */ - runtimeSpecification: string; + executionsTotal: number; /** - * Site build runtime. + * Total aggregated sum of function executions compute time. */ - buildRuntime: string; + executionsTimeTotal: number; /** - * Site framework adapter. + * Total aggregated sum of function executions mbSeconds. */ - adapter: string; + executionsMbSecondsTotal: number; /** - * Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. + * Aggregated number of function deployments per period. */ - fallbackFile: string; - } - - /** - * Template Site - */ - export type TemplateSite = { + deployments: Metric[]; /** - * Site Template ID. + * Aggregated number of function deployments storage per period. */ - key: string; + deploymentsStorage: Metric[]; /** - * Site Template Name. + * Aggregated number of function builds per period. */ - name: string; + builds: Metric[]; /** - * Short description of template + * Aggregated sum of function builds storage per period. */ - tagline: string; + buildsStorage: Metric[]; /** - * URL hosting a template demo. + * Aggregated sum of function builds compute time per period. */ - demoUrl: string; - /** - * File URL with preview screenshot in dark theme preference. - */ - screenshotDark: string; + buildsTime: Metric[]; /** - * File URL with preview screenshot in light theme preference. + * Aggregated number of function builds mbSeconds per period. */ - screenshotLight: string; + buildsMbSeconds: Metric[]; /** - * Site use cases. + * Aggregated number of function executions per period. */ - useCases: string[]; + executions: Metric[]; /** - * List of frameworks that can be used with this template. + * Aggregated number of function executions compute time per period. */ - frameworks: TemplateFramework[]; + executionsTime: Metric[]; /** - * VCS (Version Control System) Provider. + * Aggregated number of function mbSeconds per period. */ - vcsProvider: string; + executionsMbSeconds: Metric[]; /** - * VCS (Version Control System) Repository ID + * Aggregated number of successful builds per period. */ - providerRepositoryId: string; + buildsSuccess: Metric[]; /** - * VCS (Version Control System) Owner. + * Aggregated number of failed builds per period. */ - providerOwner: string; + buildsFailed: Metric[]; + } + + /** + * Variables List + */ + export type VariableList = { /** - * VCS (Version Control System) branch version (tag). + * Total number of variables that matched your query. */ - providerVersion: string; + total: number; /** - * Site variables. + * List of variables. */ - variables: TemplateVariable[]; + variables: Variable[]; } /** - * Template Framework + * Variable */ - export type TemplateFramework = { - /** - * Parent framework key. - */ - key: string; + export type Variable = { /** - * Framework Name. + * Variable ID. */ - name: string; + $id: string; /** - * The install command used to install the dependencies. + * Variable creation date in ISO 8601 format. */ - installCommand: string; + $createdAt: string; /** - * The build command used to build the deployment. + * Variable creation date in ISO 8601 format. */ - buildCommand: string; + $updatedAt: string; /** - * The output directory to store the build output. + * Variable key. */ - outputDirectory: string; + key: string; /** - * Path to site in VCS (Version Control System) repository + * Variable value. */ - providerRootDirectory: string; + value: string; /** - * Runtime used during build step of template. + * Variable secret flag. Secret variables can only be updated or deleted, but never read. */ - buildRuntime: string; + secret: boolean; /** - * Site framework runtime + * Service to which the variable belongs. Possible values are "project", "function" */ - adapter: string; + resourceType: string; /** - * Fallback file for SPA. Only relevant for static serve runtime. + * ID of resource to which the variable belongs. If resourceType is "project", it is empty. If resourceType is "function", it is ID of the function. */ - fallbackFile: string; + resourceId: string; } /** - * Function + * Health Status */ - export type Function = { - /** - * Function ID. - */ - $id: string; - /** - * Function creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Function update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Execution permissions. - */ - execute: string[]; + export type HealthStatus = { /** - * Function name. + * Name of the service. */ name: string; /** - * Function enabled. + * Duration in milliseconds how long the health check took. */ - enabled: boolean; + ping: number; /** - * Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration. + * Service status. Possible values are: `pass`, `fail` */ - live: boolean; + status: HealthCheckStatus; + } + + /** + * Health Antivirus + */ + export type HealthAntivirus = { /** - * When disabled, executions will exclude logs and errors, and will be slightly faster. + * Antivirus version. */ - logging: boolean; + version: string; /** - * Function execution and build runtime. + * Antivirus status. Possible values are: `disabled`, `offline`, `online` */ - runtime: string; + status: HealthAntivirusStatus; + } + + /** + * Status List + */ + export type HealthStatusList = { /** - * How many days to keep the non-active deployments before they will be automatically deleted. + * Total number of statuses that matched your query. */ - deploymentRetention: number; + total: number; /** - * Function's active deployment ID. + * List of statuses. */ - deploymentId: string; + statuses: HealthStatus[]; + } + + /** + * Health Certificate + */ + export type HealthCertificate = { /** - * Active deployment creation date in ISO 8601 format. + * Certificate name */ - deploymentCreatedAt: string; + name: string; /** - * Function's latest deployment ID. + * Subject SN */ - latestDeploymentId: string; + subjectSN: string; /** - * Latest deployment creation date in ISO 8601 format. + * Issuer organisation */ - latestDeploymentCreatedAt: string; + issuerOrganisation: string; /** - * Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed". + * Valid from */ - latestDeploymentStatus: string; + validFrom: string; /** - * Allowed permission scopes. + * Valid to */ - scopes: string[]; + validTo: string; /** - * Function variables. + * Signature type SN */ - vars: Variable[]; + signatureTypeSN: string; + } + + /** + * Health Queue + */ + export type HealthQueue = { /** - * Function trigger events. + * Amount of actions in the queue. */ - events: string[]; + size: number; + } + + /** + * Health Time + */ + export type HealthTime = { /** - * Function execution schedule in CRON format. + * Current unix timestamp on trustful remote server. */ - schedule: string; + remoteTime: number; /** - * Function execution timeout in seconds. + * Current unix timestamp of local server where Appwrite runs. */ - timeout: number; + localTime: number; /** - * The entrypoint file used to execute the deployment. + * Difference of unix remote and local timestamps in milliseconds. */ - entrypoint: string; + diff: number; + } + + /** + * Locale + */ + export type Locale = { /** - * The build command used to build the deployment. + * User IP address. */ - commands: string; + ip: string; /** - * Version of Open Runtimes used for the function. + * Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format */ - version: string; + countryCode: string; /** - * Function VCS (Version Control System) installation id. + * Country name. This field support localization. */ - installationId: string; + country: string; /** - * VCS (Version Control System) Repository ID + * Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America. */ - providerRepositoryId: string; + continentCode: string; /** - * VCS (Version Control System) branch name + * Continent name. This field support localization. */ - providerBranch: string; + continent: string; /** - * Path to function in VCS (Version Control System) repository + * True if country is part of the European Union. */ - providerRootDirectory: string; + eu: boolean; /** - * 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 + * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format */ - providerSilentMode: boolean; + currency: string; + } + + /** + * Locale codes list + */ + export type LocaleCodeList = { /** - * Machine specification for deployment builds. + * Total number of localeCodes that matched your query. */ - buildSpecification: string; + total: number; /** - * Machine specification for executions. + * List of localeCodes. */ - runtimeSpecification: string; + localeCodes: LocaleCode[]; } /** - * Template Function + * Continents List */ - export type TemplateFunction = { + export type ContinentList = { /** - * Function Template Icon. + * Total number of continents that matched your query. */ - icon: string; + total: number; /** - * Function Template ID. - */ - id: string; - /** - * Function Template Name. - */ - name: string; - /** - * Function Template Tagline. - */ - tagline: string; - /** - * Execution permissions. - */ - permissions: string[]; - /** - * Function trigger events. - */ - events: string[]; - /** - * Function execution schedult in CRON format. - */ - cron: string; - /** - * Function execution timeout in seconds. - */ - timeout: number; - /** - * Function use cases. - */ - useCases: string[]; - /** - * List of runtimes that can be used with this template. - */ - runtimes: TemplateRuntime[]; - /** - * Function Template Instructions. - */ - instructions: string; - /** - * VCS (Version Control System) Provider. - */ - vcsProvider: string; - /** - * VCS (Version Control System) Repository ID - */ - providerRepositoryId: string; - /** - * VCS (Version Control System) Owner. - */ - providerOwner: string; - /** - * VCS (Version Control System) branch version (tag). - */ - providerVersion: string; - /** - * Function variables. - */ - variables: TemplateVariable[]; - /** - * Function scopes. - */ - scopes: string[]; - } - - /** - * Template Runtime - */ - export type TemplateRuntime = { - /** - * Runtime Name. - */ - name: string; - /** - * The build command used to build the deployment. - */ - commands: string; - /** - * The entrypoint file used to execute the deployment. - */ - entrypoint: string; - /** - * Path to function in VCS (Version Control System) repository - */ - providerRootDirectory: string; - } - - /** - * Template Variable - */ - export type TemplateVariable = { - /** - * Variable Name. - */ - name: string; - /** - * Variable Description. - */ - description: string; - /** - * Variable Value. - */ - value: string; - /** - * Variable secret flag. Secret variables can only be updated or deleted, but never read. - */ - secret: boolean; - /** - * Variable Placeholder. - */ - placeholder: string; - /** - * Is the variable required? - */ - required: boolean; - /** - * Variable Type. + * List of continents. */ - type: string; + continents: Continent[]; } /** - * Installation + * Countries List */ - export type Installation = { - /** - * Function ID. - */ - $id: string; - /** - * Function creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Function update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * VCS (Version Control System) provider name. - */ - provider: string; + export type CountryList = { /** - * VCS (Version Control System) organization name. + * Total number of countries that matched your query. */ - organization: string; + total: number; /** - * VCS (Version Control System) installation ID. + * List of countries. */ - providerInstallationId: string; + countries: Country[]; } /** - * ProviderRepository + * Phones List */ - export type ProviderRepository = { - /** - * VCS (Version Control System) repository ID. - */ - id: string; - /** - * VCS (Version Control System) repository name. - */ - name: string; - /** - * VCS (Version Control System) organization name - */ - organization: string; - /** - * VCS (Version Control System) provider name. - */ - provider: string; - /** - * Is VCS (Version Control System) repository private? - */ - private: boolean; - /** - * VCS (Version Control System) repository's default branch name. - */ - defaultBranch: string; - /** - * VCS (Version Control System) installation ID. - */ - providerInstallationId: string; - /** - * Is VCS (Version Control System) repository authorized for the installation? - */ - authorized: boolean; + export type PhoneList = { /** - * Last commit date in ISO 8601 format. + * Total number of phones that matched your query. */ - pushedAt: string; + total: number; /** - * Environment variables found in .env files + * List of phones. */ - variables: string[]; + phones: Phone[]; } /** - * ProviderRepositoryFramework + * Currencies List */ - export type ProviderRepositoryFramework = { - /** - * VCS (Version Control System) repository ID. - */ - id: string; - /** - * VCS (Version Control System) repository name. - */ - name: string; - /** - * VCS (Version Control System) organization name - */ - organization: string; - /** - * VCS (Version Control System) provider name. - */ - provider: string; - /** - * Is VCS (Version Control System) repository private? - */ - private: boolean; - /** - * VCS (Version Control System) repository's default branch name. - */ - defaultBranch: string; - /** - * VCS (Version Control System) installation ID. - */ - providerInstallationId: string; - /** - * Is VCS (Version Control System) repository authorized for the installation? - */ - authorized: boolean; - /** - * Last commit date in ISO 8601 format. - */ - pushedAt: string; + export type CurrencyList = { /** - * Environment variables found in .env files + * Total number of currencies that matched your query. */ - variables: string[]; + total: number; /** - * Auto-detected framework. Empty if type is not "framework". + * List of currencies. */ - framework: string; + currencies: Currency[]; } - - /** - * ProviderRepositoryRuntime - */ - export type ProviderRepositoryRuntime = { - /** - * VCS (Version Control System) repository ID. - */ - id: string; - /** - * VCS (Version Control System) repository name. - */ - name: string; - /** - * VCS (Version Control System) organization name - */ - organization: string; - /** - * VCS (Version Control System) provider name. - */ - provider: string; - /** - * Is VCS (Version Control System) repository private? - */ - private: boolean; - /** - * VCS (Version Control System) repository's default branch name. - */ - defaultBranch: string; - /** - * VCS (Version Control System) installation ID. - */ - providerInstallationId: string; - /** - * Is VCS (Version Control System) repository authorized for the installation? - */ - authorized: boolean; - /** - * Last commit date in ISO 8601 format. - */ - pushedAt: string; - /** - * Environment variables found in .env files - */ - variables: string[]; - /** - * Auto-detected runtime. Empty if type is not "runtime". - */ - runtime: string; - } - - /** - * DetectionFramework - */ - export type DetectionFramework = { - /** - * Environment variables found in .env files - */ - variables?: DetectionVariable[]; - /** - * Framework - */ - framework: string; - /** - * Site Install Command - */ - installCommand: string; - /** - * Site Build Command - */ - buildCommand: string; - /** - * Site Output Directory - */ - outputDirectory: string; - } - - /** - * DetectionRuntime - */ - export type DetectionRuntime = { - /** - * Environment variables found in .env files - */ - variables?: DetectionVariable[]; - /** - * Runtime - */ - runtime: string; - /** - * Function Entrypoint - */ - entrypoint: string; - /** - * Function install and build commands - */ - commands: string; - } - - /** - * DetectionVariable - */ - export type DetectionVariable = { - /** - * Name of environment variable - */ - name: string; - /** - * Value of environment variable - */ - value: string; - } - - /** - * VcsContents - */ - export type VcsContent = { - /** - * Content size in bytes. Only files have size, and for directories, 0 is returned. - */ - size?: number; - /** - * If a content is a directory. Directories can be used to check nested contents. - */ - isDirectory?: boolean; - /** - * Name of directory or file. - */ - name: string; - } - - /** - * Branch - */ - export type Branch = { - /** - * Branch Name. - */ - name: string; - } - - /** - * Runtime - */ - export type Runtime = { - /** - * Runtime ID. - */ - $id: string; - /** - * Parent runtime key. - */ - key: string; - /** - * Runtime Name. - */ - name: string; - /** - * Runtime version. - */ - version: string; - /** - * Base Docker image used to build the runtime. - */ - base: string; - /** - * Image name of Docker Hub. - */ - image: string; - /** - * Name of the logo image. - */ - logo: string; - /** - * List of supported architectures. - */ - supports: string[]; - } - - /** - * Framework - */ - export type Framework = { - /** - * Framework key. - */ - key: string; - /** - * Framework Name. - */ - name: string; - /** - * Default runtime version. - */ - buildRuntime: string; - /** - * List of supported runtime versions. - */ - runtimes: string[]; - /** - * List of supported adapters. - */ - adapters: FrameworkAdapter[]; - } - - /** - * Framework Adapter - */ - export type FrameworkAdapter = { - /** - * Adapter key. - */ - key: string; - /** - * Default command to download dependencies. - */ - installCommand: string; - /** - * Default command to build site into output directory. - */ - buildCommand: string; - /** - * Default output directory of build. - */ - outputDirectory: string; - /** - * Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. - */ - fallbackFile: string; - } - - /** - * Deployment - */ - export type Deployment = { - /** - * Deployment ID. - */ - $id: string; - /** - * Deployment creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Deployment update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Type of deployment. - */ - type: string; - /** - * Resource ID. - */ - resourceId: string; - /** - * Resource type. - */ - resourceType: string; - /** - * The entrypoint file to use to execute the deployment code. - */ - entrypoint: string; - /** - * The code size in bytes. - */ - sourceSize: number; - /** - * The build output size in bytes. - */ - buildSize: number; - /** - * The total size in bytes (source and build output). - */ - totalSize: number; - /** - * The current build ID. - */ - buildId: string; - /** - * Whether the deployment should be automatically activated. - */ - activate: boolean; - /** - * Screenshot with light theme preference file ID. - */ - screenshotLight: string; - /** - * Screenshot with dark theme preference file ID. - */ - screenshotDark: string; - /** - * The deployment status. Possible values are "waiting", "processing", "building", "ready", "canceled" and "failed". - */ - status: DeploymentStatus; - /** - * The build logs. - */ - buildLogs: string; - /** - * The current build time in seconds. - */ - buildDuration: number; - /** - * The name of the vcs provider repository - */ - providerRepositoryName: string; - /** - * The name of the vcs provider repository owner - */ - providerRepositoryOwner: string; - /** - * The url of the vcs provider repository - */ - providerRepositoryUrl: string; - /** - * The commit hash of the vcs commit - */ - providerCommitHash: string; - /** - * The url of vcs commit author - */ - providerCommitAuthorUrl: string; - /** - * The name of vcs commit author - */ - providerCommitAuthor: string; - /** - * The commit message - */ - providerCommitMessage: string; - /** - * The url of the vcs commit - */ - providerCommitUrl: string; - /** - * The branch of the vcs repository - */ - providerBranch: string; - /** - * The branch of the vcs repository - */ - providerBranchUrl: string; - } - - /** - * Execution - */ - export type Execution = { - /** - * Execution ID. - */ - $id: string; - /** - * Execution creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Execution update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Execution roles. - */ - $permissions: string[]; - /** - * Function ID. - */ - functionId: string; - /** - * Function's deployment ID used to create the execution. - */ - deploymentId: string; - /** - * The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`. - */ - trigger: ExecutionTrigger; - /** - * The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, `failed`, or `scheduled`. - */ - status: ExecutionStatus; - /** - * HTTP request method type. - */ - requestMethod: string; - /** - * HTTP request path and query. - */ - requestPath: string; - /** - * HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. - */ - requestHeaders: Headers[]; - /** - * HTTP response status code. - */ - responseStatusCode: number; - /** - * HTTP response body. This will return empty unless execution is created as synchronous. - */ - responseBody: string; - /** - * HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. - */ - responseHeaders: Headers[]; - /** - * Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. - */ - logs: string; - /** - * Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. - */ - errors: string; - /** - * Resource(function/site) execution duration in seconds. - */ - duration: number; - /** - * The scheduled time for execution. If left empty, execution will be queued immediately. - */ - scheduledAt?: string; - } - - /** - * Project - */ - export type Project = { - /** - * Project ID. - */ - $id: string; - /** - * Project creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Project update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * 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; + + /** + * Languages List + */ + export type LanguageList = { /** - * Max users allowed. 0 is unlimited. + * Total number of languages that matched your query. */ - authLimit: number; + total: number; /** - * Max sessions allowed per user. 100 maximum. + * List of languages. */ - authSessionsLimit: number; + languages: Language[]; + } + + /** + * Message list + */ + export type MessageList = { /** - * Max allowed passwords in the history list per user. Max passwords limit allowed in history is 20. Use 0 for disabling password history. + * Total number of messages that matched your query. */ - authPasswordHistory: number; + total: number; /** - * Whether or not to check user's password against most commonly used passwords. + * List of messages. */ - authPasswordDictionary: boolean; + messages: Message[]; + } + + /** + * Message + */ + export type Message = { /** - * Whether or not to check the user password for similarity with their personal data. + * Message ID. */ - authPersonalDataCheck: boolean; + $id: string; /** - * An array of mock numbers and their corresponding verification codes (OTPs). + * Message creation time in ISO 8601 format. */ - authMockNumbers: MockNumber[]; + $createdAt: string; /** - * Whether or not to send session alert emails to users. + * Message update date in ISO 8601 format. */ - authSessionAlerts: boolean; + $updatedAt: string; /** - * Whether or not to show user names in the teams membership response. + * Message provider type. */ - authMembershipsUserName: boolean; + providerType: string; /** - * Whether or not to show user emails in the teams membership response. + * Topic IDs set as recipients. */ - authMembershipsUserEmail: boolean; + topics: string[]; /** - * Whether or not to show user MFA status in the teams membership response. + * User IDs set as recipients. */ - authMembershipsMfa: boolean; + users: string[]; /** - * Whether or not all existing sessions should be invalidated on password change + * Target IDs set as recipients. */ - authInvalidateSessions: boolean; + targets: string[]; /** - * List of Auth Providers. + * The scheduled time for message. */ - oAuthProviders: AuthProvider[]; + scheduledAt?: string; /** - * List of Platforms. + * The time when the message was delivered. */ - platforms: Platform[]; + deliveredAt?: string; /** - * List of Webhooks. + * Delivery errors if any. */ - webhooks: Webhook[]; + deliveryErrors?: string[]; /** - * List of API Keys. + * Number of recipients the message was delivered to. */ - keys: Key[]; + deliveredTotal: number; /** - * List of dev keys. + * Data of the message. */ - devKeys: DevKey[]; + data: object; /** - * Status for custom SMTP + * Status of delivery. */ - smtpEnabled: boolean; + status: MessageStatus; + } + + /** + * Target list + */ + export type TargetList = { /** - * SMTP sender name + * Total number of targets that matched your query. */ - smtpSenderName: string; + total: number; /** - * SMTP sender email + * List of targets. */ - smtpSenderEmail: string; + targets: Target[]; + } + + /** + * Provider list + */ + export type ProviderList = { /** - * SMTP reply to email + * Total number of providers that matched your query. */ - smtpReplyTo: string; + total: number; /** - * SMTP server host name + * List of providers. */ - smtpHost: string; + providers: Provider[]; + } + + /** + * Provider + */ + export type Provider = { /** - * SMTP server port + * Provider ID. */ - smtpPort: number; + $id: string; /** - * SMTP server username + * Provider creation time in ISO 8601 format. */ - smtpUsername: string; + $createdAt: string; /** - * SMTP server password + * Provider update date in ISO 8601 format. */ - smtpPassword: string; + $updatedAt: string; /** - * SMTP server secure protocol + * The name for the provider instance. */ - smtpSecure: string; + name: string; /** - * Number of times the ping was received for this project. + * The name of the provider service. */ - pingCount: number; + provider: string; /** - * Last ping datetime in ISO 8601 format. + * Is provider enabled? */ - pingedAt: string; + enabled: boolean; /** - * Labels for the project. + * Type of provider. */ - labels: string[]; + type: string; /** - * Project status + * Provider credentials. */ - status: string; + credentials: object; /** - * Email/Password auth method status + * Provider options. */ - authEmailPassword: boolean; + options?: object; + } + + /** + * Topic list + */ + export type TopicList = { /** - * Magic URL auth method status + * Total number of topics that matched your query. */ - authUsersAuthMagicURL: boolean; + total: number; /** - * Email (OTP) auth method status + * List of topics. */ - authEmailOtp: boolean; + topics: Topic[]; + } + + /** + * Topic + */ + export type Topic = { /** - * Anonymous auth method status + * Topic ID. */ - authAnonymous: boolean; + $id: string; /** - * Invites auth method status + * Topic creation time in ISO 8601 format. */ - authInvites: boolean; + $createdAt: string; /** - * JWT auth method status + * Topic update date in ISO 8601 format. */ - authJWT: boolean; + $updatedAt: string; /** - * Phone auth method status + * The name of the topic. */ - authPhone: boolean; + name: string; /** - * Account service status + * Total count of email subscribers subscribed to the topic. */ - serviceStatusForAccount: boolean; + emailTotal: number; /** - * Avatars service status + * Total count of SMS subscribers subscribed to the topic. */ - serviceStatusForAvatars: boolean; + smsTotal: number; /** - * Databases (legacy) service status + * Total count of push subscribers subscribed to the topic. */ - serviceStatusForDatabases: boolean; + pushTotal: number; /** - * TablesDB service status + * Subscribe permissions. */ - serviceStatusForTablesdb: boolean; + subscribe: string[]; + } + + /** + * Subscriber list + */ + export type SubscriberList = { /** - * Locale service status + * Total number of subscribers that matched your query. */ - serviceStatusForLocale: boolean; + total: number; /** - * Health service status + * List of subscribers. */ - serviceStatusForHealth: boolean; + subscribers: Subscriber[]; + } + + /** + * Subscriber + */ + export type Subscriber = { /** - * Storage service status + * Subscriber ID. */ - serviceStatusForStorage: boolean; + $id: string; /** - * Teams service status + * Subscriber creation time in ISO 8601 format. */ - serviceStatusForTeams: boolean; + $createdAt: string; /** - * Users service status + * Subscriber update date in ISO 8601 format. */ - serviceStatusForUsers: boolean; + $updatedAt: string; /** - * Sites service status + * Target ID. */ - serviceStatusForSites: boolean; + targetId: string; /** - * Functions service status + * Target. */ - serviceStatusForFunctions: boolean; + target: Target; /** - * GraphQL service status + * Topic ID. */ - serviceStatusForGraphql: boolean; + userId: string; /** - * Messaging service status + * User Name. */ - serviceStatusForMessaging: boolean; + userName: string; /** - * Project region + * Topic ID. */ - region: string; + topicId: string; /** - * Billing limits reached + * The target provider type. Can be one of the following: `email`, `sms` or `push`. */ - billingLimits: BillingLimits; + providerType: string; + } + + /** + * Migrations List + */ + export type MigrationList = { /** - * Project blocks information + * Total number of migrations that matched your query. */ - blocks: Block[]; + total: number; /** - * Last time the project was accessed via console. Used with plan's projectInactivityDays to determine if project is paused. + * List of migrations. */ - consoleAccessedAt: string; + migrations: Migration[]; } /** - * Webhook + * Migration */ - export type Webhook = { + export type Migration = { /** - * Webhook ID. + * Migration ID. */ $id: string; /** - * Webhook creation date in ISO 8601 format. + * Migration creation date in ISO 8601 format. */ $createdAt: string; /** - * Webhook update date in ISO 8601 format. + * Variable creation date in ISO 8601 format. */ $updatedAt: string; /** - * Webhook name. + * Migration status ( pending, processing, failed, completed ) */ - name: string; + status: string; /** - * Webhook URL endpoint. + * Migration stage ( init, processing, source-check, destination-check, migrating, finished ) */ - url: string; + stage: string; /** - * Webhook trigger events. + * A string containing the type of source of the migration. */ - events: string[]; + source: string; /** - * Indicated if SSL / TLS Certificate verification is enabled. + * A string containing the type of destination of the migration. */ - security: boolean; + destination: string; /** - * HTTP basic authentication username. + * Resources to migrate. */ - httpUser: string; + resources: string[]; /** - * HTTP basic authentication password. + * Id of the resource to migrate. */ - httpPass: string; + resourceId: string; /** - * Signature key which can be used to validated incoming + * A group of counters that represent the total progress of the migration. */ - signatureKey: string; + statusCounters: object; /** - * Indicates if this webhook is enabled. + * An array of objects containing the report data of the resources that were migrated. */ - enabled: boolean; + resourceData: object; /** - * Webhook error logs from the most recent failure. + * All errors that occurred during the migration process. */ - logs: string; + errors: string[]; /** - * Number of consecutive failed webhook attempts. + * Migration options used during the migration process. */ - attempts: number; + options: object; } /** - * Key + * Migration Report */ - export type Key = { - /** - * Key ID. - */ - $id: string; - /** - * Key creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Key update date in ISO 8601 format. - */ - $updatedAt: string; + export type MigrationReport = { /** - * Key name. + * Number of users to be migrated. */ - name: string; + user: number; /** - * Key expiration date in ISO 8601 format. + * Number of teams to be migrated. */ - expire: string; + team: number; /** - * Allowed permission scopes. + * Number of databases to be migrated. */ - scopes: string[]; + database: number; /** - * Secret key. + * Number of rows to be migrated. */ - secret: string; + row: number; /** - * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + * Number of files to be migrated. */ - accessedAt: string; + file: number; /** - * List of SDK user agents that used this key. + * Number of buckets to be migrated. */ - sdks: string[]; - } - - /** - * DevKey - */ - export type DevKey = { + bucket: number; /** - * Key ID. + * Number of functions to be migrated. */ - $id: string; + function: number; /** - * Key creation date in ISO 8601 format. + * Number of sites to be migrated. */ - $createdAt: string; + site: number; /** - * Key update date in ISO 8601 format. + * Number of providers to be migrated. */ - $updatedAt: string; + provider: number; /** - * Key name. + * Number of topics to be migrated. */ - name: string; + topic: number; /** - * Key expiration date in ISO 8601 format. + * Number of subscribers to be migrated. */ - expire: string; + subscriber: number; /** - * Secret key. + * Number of messages to be migrated. */ - secret: string; + message: number; /** - * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + * Size of files to be migrated in mb. */ - accessedAt: string; + size: number; /** - * List of SDK user agents that used this key. + * Version of the Appwrite instance to be migrated. */ - sdks: string[]; + version: string; } /** - * Mock Number + * Organizations list */ - export type MockNumber = { + export type OrganizationList = { /** - * Mock phone number for testing phone authentication. Useful for testing phone authentication without sending an SMS. + * Total number of teams that matched your query. */ - phone: string; + total: number; /** - * Mock OTP for the number. + * List of teams. */ - otp: string; + teams: Organization[]; } /** - * AuthProvider + * PaymentAuthentication */ - export type AuthProvider = { - /** - * Auth Provider. - */ - key: string; + export type PaymentAuthentication = { /** - * Auth Provider name. + * Message for the end user to show on Console. */ - name: string; + message: string; /** - * OAuth 2.0 application ID. + * Stripe client secret to use for validation. */ - appId: string; + clientSecret: string; /** - * OAuth 2.0 application secret. Might be JSON string if provider requires extra configuration. + * Organization ID for which the payment authentication is needed. */ - secret: string; + organizationId: string; /** - * Auth Provider is active and can be used to create session. + * Invoice ID against which the payment needs to be validated. */ - enabled: boolean; + invoiceId: string; } /** - * Platform + * Estimation */ - export type Platform = { + export type Estimation = { /** - * Platform ID. + * Total amount */ - $id: string; + amount: number; /** - * Platform creation date in ISO 8601 format. + * Gross payable amount */ - $createdAt: string; + grossAmount: number; /** - * Platform update date in ISO 8601 format. + * Discount amount */ - $updatedAt: string; + discount: number; /** - * Platform name. + * Credits amount */ - name: string; + credits: number; /** - * Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android. + * Estimation items */ - type: PlatformType; + items: EstimationItem[]; /** - * Platform Key. iOS bundle ID or Android package name. Empty string for other platforms. + * Estimation discount items */ - key: string; + discounts: EstimationItem[]; /** - * App store or Google Play store ID. + * Trial days */ - store: string; + trialDays: number; /** - * Web app hostname. Empty string for other platforms. + * Trial end date */ - hostname: string; + trialEndDate?: string; + } + + /** + * Aggregation team list + */ + export type AggregationTeamList = { /** - * HTTP basic authentication username. + * Total number of aggregations that matched your query. */ - httpUser: string; + total: number; /** - * HTTP basic authentication password. + * List of aggregations. */ - httpPass: string; + aggregations: AggregationTeam[]; } /** - * Variable + * AggregationTeam */ - export type Variable = { + export type AggregationTeam = { /** - * Variable ID. + * 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 */ - $id: string; + from: string; /** - * Variable creation date in ISO 8601 format. + * End date of the invoice */ - $createdAt: string; + to: string; /** - * Variable creation date in ISO 8601 format. + * Total storage usage */ - $updatedAt: string; + usageStorage: number; /** - * Variable key. + * Total storage usage with builds storage */ - key: string; + usageTotalStorage: number; /** - * Variable value. + * Total files storage usage */ - value: string; + usageFilesStorage: number; /** - * Variable secret flag. Secret variables can only be updated or deleted, but never read. + * Total deployments storage usage */ - secret: boolean; + usageDeploymentsStorage: number; /** - * Service to which the variable belongs. Possible values are "project", "function" + * Total builds storage usage */ - resourceType: string; + usageBuildsStorage: number; /** - * ID of resource to which the variable belongs. If resourceType is "project", it is empty. If resourceType is "function", it is ID of the function. + * Total databases storage usage */ - resourceId: string; - } - - /** - * Country - */ - export type Country = { + usageDatabasesStorage: number; /** - * Country name. + * Total active users for the billing period */ - name: string; + usageUsers: number; /** - * Country two-character ISO 3166-1 alpha code. + * Total number of executions for the billing period */ - code: string; - } - - /** - * Continent - */ - export type Continent = { + usageExecutions: number; /** - * Continent name. + * Total bandwidth usage for the billing period */ - name: string; + usageBandwidth: number; /** - * Continent two letter code. + * Peak concurrent realtime connections for the billing period */ - code: string; - } - - /** - * Language - */ - export type Language = { + usageRealtime: number; /** - * Language name. + * Total realtime messages sent for the billing period */ - name: string; + usageRealtimeMessages: number; /** - * Language two-character ISO 639-1 codes. + * Total realtime bandwidth usage for the billing period */ - code: string; + usageRealtimeBandwidth: number; /** - * Language native name. + * Additional members */ - nativeName: string; - } - - /** - * Currency - */ - export type Currency = { + additionalMembers: number; /** - * Currency symbol. + * Additional members cost */ - symbol: string; + additionalMemberAmount: number; /** - * Currency name. + * Additional storage usage cost */ - name: string; + additionalStorageAmount: number; /** - * Currency native symbol. + * Additional users usage cost. */ - symbolNative: string; + additionalUsersAmount: number; /** - * Number of decimal digits. + * Additional executions usage cost */ - decimalDigits: number; + additionalExecutionsAmount: number; /** - * Currency digit rounding. + * Additional bandwidth usage cost */ - rounding: number; + additionalBandwidthAmount: number; /** - * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format. + * Additional realtime usage cost */ - code: string; + additionalRealtimeAmount: number; /** - * Currency plural name + * Billing plan */ - namePlural: string; - } - - /** - * Phone - */ - export type Phone = { + plan: string; /** - * Phone code. + * Aggregated amount */ - code: string; + amount: number; /** - * Country two-character ISO 3166-1 alpha code. + * Aggregation project breakdown */ - countryCode: string; + breakdown: AggregationBreakdown[]; /** - * Country name. + * Usage resources */ - countryName: string; + resources: UsageResources[]; } /** - * Health Antivirus + * CreditList */ - export type HealthAntivirus = { + export type CreditList = { /** - * Antivirus version. + * Credits */ - version: string; + credits: Credit[]; /** - * Antivirus status. Possible values are: `disabled`, `offline`, `online` + * Total number of credits */ - status: HealthAntivirusStatus; - } - - /** - * Health Queue - */ - export type HealthQueue = { + total: number; /** - * Amount of actions in the queue. + * Total available credit balance in USD */ - size: number; + available: number; } /** - * Health Status + * Credit */ - export type HealthStatus = { - /** - * Name of the service. - */ - name: string; + export type Credit = { /** - * Duration in milliseconds how long the health check took. + * Credit ID. */ - ping: number; + $id: string; /** - * Service status. Possible values are: `pass`, `fail` + * Credit creation time in ISO 8601 format. */ - status: HealthCheckStatus; - } - - /** - * Health Certificate - */ - export type HealthCertificate = { + $createdAt: string; /** - * Certificate name + * Credit update date in ISO 8601 format. */ - name: string; + $updatedAt: string; /** - * Subject SN + * Credit permissions. [Learn more about permissions](/docs/permissions). */ - subjectSN: string; + $permissions: string[]; /** - * Issuer organisation + * coupon ID */ - issuerOrganisation: string; + couponId: string; /** - * Valid from + * ID of the User. */ - validFrom: string; + userId: string; /** - * Valid to + * ID of the Team. */ - validTo: string; + teamId: string; /** - * Signature type SN + * Provided credit amount */ - signatureTypeSN: string; - } - - /** - * Health Time - */ - export type HealthTime = { + credits: number; /** - * Current unix timestamp on trustful remote server. + * Provided credit amount */ - remoteTime: number; + total: number; /** - * Current unix timestamp of local server where Appwrite runs. + * Credit expiration time in ISO 8601 format. */ - localTime: number; + expiration: string; /** - * Difference of unix remote and local timestamps in milliseconds. + * Status of the credit. Can be one of `disabled`, `active` or `expired`. */ - diff: number; + status: string; } /** - * Metric + * CreditAvailable */ - export type Metric = { + export type CreditAvailable = { /** - * The value of this metric at the timestamp. + * Total available credits for the organization. */ - value: number; + available: number; + } + + /** + * EstimationDeleteOrganization + */ + export type EstimationDeleteOrganization = { /** - * The date at which this metric was aggregated in ISO 8601 format. + * List of unpaid invoices */ - date: string; + unpaidInvoices: Invoice[]; } /** - * Metric Breakdown + * EstimationUpdatePlan */ - export type MetricBreakdown = { + export type EstimationUpdatePlan = { + /** + * Total amount + */ + amount: number; + /** + * Gross payable amount + */ + grossAmount: number; + /** + * Discount amount + */ + discount: number; + /** + * Credits amount + */ + credits: number; + /** + * Estimation items + */ + items: EstimationItem[]; /** - * Resource ID. + * Estimation discount items */ - resourceId?: string; + discounts: EstimationItem[]; /** - * Resource name. + * Trial days */ - name: string; + trialDays: number; /** - * The value of this metric at the timestamp. + * Trial end date */ - value: number; + trialEndDate?: string; /** - * The estimated value of this metric at the end of the period. + * Organization's existing credits */ - estimate?: number; + organizationCredits: number; } /** - * UsageDatabases + * Downgrade Feedback */ - export type UsageDatabases = { + export type DowngradeFeedback = { /** - * Time range of the usage stats. + * Feedback ID. */ - range: string; + $id: string; /** - * Total aggregated number of databases. + * Feedback creation date in ISO 8601 format. */ - databasesTotal: number; + $createdAt: string; /** - * Total aggregated number of collections. + * Feedback update date in ISO 8601 format. */ - collectionsTotal: number; + $updatedAt: string; /** - * Total aggregated number of tables. + * Feedback reason */ - tablesTotal: number; + title: string; /** - * Total aggregated number of documents. + * Feedback message */ - documentsTotal: number; + message: string; /** - * Total aggregated number of rows. + * Plan ID downgrading from */ - rowsTotal: number; + fromPlanId: string; /** - * Total aggregated number of total databases storage in bytes. + * Plan ID downgrading to */ - storageTotal: number; + toPlanId: string; /** - * Total number of databases reads. + * Organization ID */ - databasesReadsTotal: number; + teamId: string; /** - * Total number of databases writes. + * User ID who submitted feedback */ - databasesWritesTotal: number; + userId: string; /** - * Aggregated number of databases per period. + * Console version */ - databases: Metric[]; + version: string; + } + + /** + * Invoice + */ + export type Invoice = { /** - * Aggregated number of collections per period. + * Invoice ID. */ - collections: Metric[]; + $id: string; /** - * Aggregated number of tables per period. + * Invoice creation time in ISO 8601 format. */ - tables: Metric[]; + $createdAt: string; /** - * Aggregated number of documents per period. + * Invoice update date in ISO 8601 format. */ - documents: Metric[]; + $updatedAt: string; /** - * Aggregated number of rows per period. + * Invoice permissions. [Learn more about permissions](/docs/permissions). */ - rows: Metric[]; + $permissions: string[]; /** - * An array of the aggregated number of databases storage in bytes per period. + * Project ID */ - storage: Metric[]; + teamId: string; /** - * An array of aggregated number of database reads. + * Aggregation ID */ - databasesReads: Metric[]; + aggregationId: string; /** - * An array of aggregated number of database writes. + * Billing plan selected. Can be one of `tier-0`, `tier-1` or `tier-2`. */ - databasesWrites: Metric[]; - } - - /** - * UsageDatabase - */ - export type UsageDatabase = { + plan: string; /** - * Time range of the usage stats. + * Usage breakdown per resource */ - range: string; + usage: UsageResources[]; /** - * Total aggregated number of collections. + * Invoice Amount */ - collectionsTotal: number; + amount: number; /** - * Total aggregated number of tables. + * Tax percentage */ - tablesTotal: number; + tax: number; /** - * Total aggregated number of documents. + * Tax amount */ - documentsTotal: number; + taxAmount: number; /** - * Total aggregated number of rows. + * VAT percentage */ - rowsTotal: number; + vat: number; /** - * Total aggregated number of total storage used in bytes. + * VAT amount */ - storageTotal: number; + vatAmount: number; /** - * Total number of databases reads. + * Gross amount after vat, tax, and discounts applied. */ - databaseReadsTotal: number; + grossAmount: number; /** - * Total number of databases writes. + * Credits used. */ - databaseWritesTotal: number; + creditsUsed: number; /** - * Aggregated number of collections per period. + * Currency the invoice is in */ - collections: Metric[]; + currency: string; /** - * Aggregated number of tables per period. + * Client secret for processing failed payments in front-end */ - tables: Metric[]; + clientSecret: string; /** - * Aggregated number of documents per period. + * Invoice status */ - documents: Metric[]; + status: string; /** - * Aggregated number of rows per period. + * Last payment error associated with the invoice */ - rows: Metric[]; + lastError: string; /** - * Aggregated storage used in bytes per period. + * Invoice due date. */ - storage: Metric[]; + dueAt: string; /** - * An array of aggregated number of database reads. + * Beginning date of the invoice */ - databaseReads: Metric[]; + from: string; /** - * An array of aggregated number of database writes. + * End date of the invoice */ - databaseWrites: Metric[]; + to: string; } /** - * UsageTable + * Roles */ - export type UsageTable = { - /** - * Time range of the usage stats. - */ - range: string; + export type Roles = { /** - * Total aggregated number of of rows. + * Array of scopes accessible to current user. */ - rowsTotal: number; + scopes: string[]; /** - * Aggregated number of rows per period. + * Array of roles assigned to current user. */ - rows: Metric[]; + roles: string[]; } /** - * UsageCollection + * UsageOrganization */ - export type UsageCollection = { + export type UsageOrganization = { /** - * Time range of the usage stats. + * Aggregated stats for number of requests. */ - range: string; + bandwidth: Metric[]; /** - * Total aggregated number of of documents. + * Aggregated stats for consumed bandwidth. */ - documentsTotal: number; + users: Metric[]; /** - * Aggregated number of documents per period. + * Aggregated stats for function executions. */ - documents: Metric[]; - } - - /** - * UsageUsers - */ - export type UsageUsers = { + executions: Metric[]; /** - * Time range of the usage stats. + * Aggregated stats for database reads. */ - range: string; + databasesReads: Metric[]; /** - * Total aggregated number of statistics of users. + * Aggregated stats for database writes. */ - usersTotal: number; + databasesWrites: Metric[]; /** - * Total aggregated number of active sessions. + * Aggregated stats for file transformations. */ - sessionsTotal: number; + imageTransformations: Metric[]; /** - * Aggregated number of users per period. + * Aggregated stats for total file transformations. */ - users: Metric[]; + imageTransformationsTotal: number; /** - * Aggregated number of active sessions per period. + * Aggregated stats for file transformations. */ - sessions: Metric[]; - } - - /** - * StorageUsage - */ - export type UsageStorage = { + screenshotsGenerated: Metric[]; /** - * Time range of the usage stats. + * Aggregated stats for total file transformations. */ - range: string; + screenshotsGeneratedTotal: number; /** - * Total aggregated number of buckets + * Aggregated stats for imagine credits. */ - bucketsTotal: number; + imagineCredits: Metric[]; /** - * Total aggregated number of files. + * Aggregated stats for total imagine credits. */ - filesTotal: number; + imagineCreditsTotal: number; /** - * Total aggregated number of files storage (in bytes). + * Aggregated stats for total users. + */ + usersTotal: number; + /** + * Aggregated stats for total executions. + */ + executionsTotal: number; + /** + * Aggregated stats for function executions in mb seconds. + */ + executionsMBSecondsTotal: number; + /** + * Aggregated stats for function builds in mb seconds. + */ + buildsMBSecondsTotal: number; + /** + * Aggregated stats for total file storage. */ filesStorageTotal: number; /** - * Aggregated number of buckets per period. + * Aggregated stats for total builds storage. */ - buckets: Metric[]; + buildsStorageTotal: number; /** - * Aggregated number of files per period. + * Aggregated stats for total deployments storage. */ - files: Metric[]; + deploymentsStorageTotal: number; /** - * Aggregated number of files storage (in bytes) per period . + * Aggregated stats for total databases storage. */ - storage: Metric[]; - } - - /** - * UsageBuckets - */ - export type UsageBuckets = { + databasesStorageTotal: number; /** - * Time range of the usage stats. + * Aggregated stats for total databases reads. */ - range: string; + databasesReadsTotal: number; /** - * Total aggregated number of bucket files. + * Aggregated stats for total databases writes. */ - filesTotal: number; + databasesWritesTotal: number; /** - * Total aggregated number of bucket files storage (in bytes). + * Aggregated stats for total backups storage. */ - filesStorageTotal: number; + backupsStorageTotal: number; /** - * Aggregated number of bucket files per period. + * Aggregated stats for total storage. */ - files: Metric[]; + storageTotal: number; /** - * Aggregated number of bucket storage files (in bytes) per period. + * Aggregated stats for total auth phone. */ - storage: Metric[]; + authPhoneTotal: number; /** - * Aggregated number of files transformations per period. + * Aggregated stats for total auth phone estimation. */ - imageTransformations: Metric[]; + authPhoneEstimate: number; /** - * Total aggregated number of files transformations. + * Aggregated stats for each projects. */ - imageTransformationsTotal: number; + projects: UsageOrganizationProject[]; } /** - * UsageFunctions + * UsageProject */ - export type UsageFunctions = { - /** - * Time range of the usage stats. - */ - range: string; - /** - * Total aggregated number of functions. - */ - functionsTotal: number; - /** - * Total aggregated number of functions deployments. - */ - deploymentsTotal: number; + export type UsageProject = { /** - * Total aggregated sum of functions deployment storage. + * Total aggregated number of function executions. */ - deploymentsStorageTotal: number; + executionsTotal: number; /** - * Total aggregated number of functions build. + * Total aggregated number of documents in legacy/tablesdb. */ - buildsTotal: number; + documentsTotal: number; /** - * total aggregated sum of functions build storage. + * Total aggregated number of documents in documentsdb. */ - buildsStorageTotal: number; + documentsdbDocumentsTotal: number; /** - * Total aggregated sum of functions build compute time. + * Total aggregated number of rows. */ - buildsTimeTotal: number; + rowsTotal: number; /** - * Total aggregated sum of functions build mbSeconds. + * Total aggregated number of databases. */ - buildsMbSecondsTotal: number; + databasesTotal: number; /** - * Total aggregated number of functions execution. + * Total aggregated number of documentsdb. */ - executionsTotal: number; + documentsdbTotal: number; /** - * Total aggregated sum of functions execution compute time. + * Total aggregated sum of databases storage size (in bytes). */ - executionsTimeTotal: number; + databasesStorageTotal: number; /** - * Total aggregated sum of functions execution mbSeconds. + * Total aggregated sum of documentsdb databases storage size (in bytes). */ - executionsMbSecondsTotal: number; + documentsdbDatabasesStorageTotal: number; /** - * Aggregated number of functions per period. + * Total aggregated number of users. */ - functions: Metric[]; + usersTotal: number; /** - * Aggregated number of functions deployment per period. + * Total aggregated sum of files storage size (in bytes). */ - deployments: Metric[]; + filesStorageTotal: number; /** - * Aggregated number of functions deployment storage per period. + * Total aggregated sum of functions storage size (in bytes). */ - deploymentsStorage: Metric[]; + functionsStorageTotal: number; /** - * Total aggregated number of successful function builds. + * Total aggregated sum of builds storage size (in bytes). */ - buildsSuccessTotal: number; + buildsStorageTotal: number; /** - * Total aggregated number of failed function builds. + * Total aggregated sum of deployments storage size (in bytes). */ - buildsFailedTotal: number; + deploymentsStorageTotal: number; /** - * Aggregated number of functions build per period. + * Total aggregated number of buckets. */ - builds: Metric[]; + bucketsTotal: number; /** - * Aggregated sum of functions build storage per period. + * Total aggregated number of function executions mbSeconds. */ - buildsStorage: Metric[]; + executionsMbSecondsTotal: number; /** - * Aggregated sum of functions build compute time per period. + * Total aggregated number of function builds mbSeconds. */ - buildsTime: Metric[]; + buildsMbSecondsTotal: number; /** - * Aggregated sum of functions build mbSeconds per period. + * Aggregated stats for total databases reads. */ - buildsMbSeconds: Metric[]; + databasesReadsTotal: number; /** - * Aggregated number of functions execution per period. + * Aggregated stats for total databases writes. */ - executions: Metric[]; + databasesWritesTotal: number; /** - * Aggregated number of functions execution compute time per period. + * Total number of documentsdb databases reads. */ - executionsTime: Metric[]; + documentsdbDatabasesReadsTotal: number; /** - * Aggregated number of functions mbSeconds per period. + * Total number of documentsdb databases writes. */ - executionsMbSeconds: Metric[]; + documentsdbDatabasesWritesTotal: number; /** - * Aggregated number of successful function builds per period. + * Aggregated number of requests per period. */ - buildsSuccess: Metric[]; + requests: Metric[]; /** - * Aggregated number of failed function builds per period. + * Aggregated number of consumed bandwidth per period. */ - buildsFailed: Metric[]; - } - - /** - * UsageFunction - */ - export type UsageFunction = { + network: Metric[]; /** - * The time range of the usage stats. + * Aggregated number of users per period. */ - range: string; + users: Metric[]; /** - * Total aggregated number of function deployments. + * Aggregated number of executions per period. */ - deploymentsTotal: number; + executions: Metric[]; /** - * Total aggregated sum of function deployments storage. + * Aggregated breakdown in totals of executions by functions. */ - deploymentsStorageTotal: number; + executionsBreakdown: MetricBreakdown[]; /** - * Total aggregated number of function builds. + * Aggregated breakdown in totals of usage by buckets. */ - buildsTotal: number; + bucketsBreakdown: MetricBreakdown[]; /** - * Total aggregated number of successful function builds. + * An array of the aggregated breakdown of storage usage by databases. */ - buildsSuccessTotal: number; + databasesStorageBreakdown: MetricBreakdown[]; /** - * Total aggregated number of failed function builds. + * Aggregated breakdown in totals of execution mbSeconds by functions. */ - buildsFailedTotal: number; + executionsMbSecondsBreakdown: MetricBreakdown[]; /** - * total aggregated sum of function builds storage. + * Aggregated breakdown in totals of build mbSeconds by functions. */ - buildsStorageTotal: number; + buildsMbSecondsBreakdown: MetricBreakdown[]; /** - * Total aggregated sum of function builds compute time. + * Aggregated breakdown in totals of functions storage size (in bytes). */ - buildsTimeTotal: number; + functionsStorageBreakdown: MetricBreakdown[]; /** - * Average builds compute time. + * Aggregated stats for total auth phone. */ - buildsTimeAverage: number; + authPhoneTotal: number; /** - * Total aggregated sum of function builds mbSeconds. + * Aggregated stats for total auth phone estimation. */ - buildsMbSecondsTotal: number; + authPhoneEstimate: number; /** - * Total aggregated number of function executions. + * Aggregated breakdown in totals of phone auth by country. */ - executionsTotal: number; + authPhoneCountryBreakdown: MetricBreakdown[]; /** - * Total aggregated sum of function executions compute time. + * Aggregated stats for database reads. */ - executionsTimeTotal: number; + databasesReads: Metric[]; /** - * Total aggregated sum of function executions mbSeconds. + * Aggregated stats for database writes. */ - executionsMbSecondsTotal: number; + databasesWrites: Metric[]; /** - * Aggregated number of function deployments per period. + * An array of aggregated number of documentsdb database reads. */ - deployments: Metric[]; + documentsdbDatabasesReads: Metric[]; /** - * Aggregated number of function deployments storage per period. + * An array of aggregated number of documentsdb database writes. */ - deploymentsStorage: Metric[]; + documentsdbDatabasesWrites: Metric[]; /** - * Aggregated number of function builds per period. + * An array of aggregated sum of documentsdb databases storage size (in bytes) per period. */ - builds: Metric[]; + documentsdbDatabasesStorage: Metric[]; /** - * Aggregated sum of function builds storage per period. + * An array of aggregated number of image transformations. */ - buildsStorage: Metric[]; + imageTransformations: Metric[]; /** - * Aggregated sum of function builds compute time per period. + * Total aggregated number of image transformations. */ - buildsTime: Metric[]; + imageTransformationsTotal: number; /** - * Aggregated number of function builds mbSeconds per period. + * Total aggregated number of VectorsDB databases. */ - buildsMbSeconds: Metric[]; + vectorsdbDatabasesTotal: number; /** - * Aggregated number of function executions per period. + * Total aggregated number of VectorsDB collections. */ - executions: Metric[]; + vectorsdbCollectionsTotal: number; /** - * Aggregated number of function executions compute time per period. + * Total aggregated number of VectorsDB documents. */ - executionsTime: Metric[]; + vectorsdbDocumentsTotal: number; /** - * Aggregated number of function mbSeconds per period. + * Total aggregated VectorsDB storage (bytes). */ - executionsMbSeconds: Metric[]; + vectorsdbDatabasesStorageTotal: number; /** - * Aggregated number of successful builds per period. + * Total aggregated number of VectorsDB reads. */ - buildsSuccess: Metric[]; + vectorsdbDatabasesReadsTotal: number; /** - * Aggregated number of failed builds per period. + * Total aggregated number of VectorsDB writes. */ - buildsFailed: Metric[]; - } - - /** - * UsageSites - */ - export type UsageSites = { + vectorsdbDatabasesWritesTotal: number; /** - * Time range of the usage stats. + * Aggregated VectorsDB databases per period. */ - range: string; + vectorsdbDatabases: Metric[]; /** - * Total aggregated number of sites. + * Aggregated VectorsDB collections per period. */ - sitesTotal: number; + vectorsdbCollections: Metric[]; /** - * Aggregated number of sites per period. + * Aggregated VectorsDB documents per period. */ - sites: Metric[]; + vectorsdbDocuments: Metric[]; /** - * Total aggregated number of sites deployments. + * Aggregated VectorsDB storage per period. */ - deploymentsTotal: number; + vectorsdbDatabasesStorage: Metric[]; /** - * Total aggregated sum of sites deployment storage. + * Aggregated VectorsDB reads per period. */ - deploymentsStorageTotal: number; + vectorsdbDatabasesReads: Metric[]; /** - * Total aggregated number of sites build. + * Aggregated VectorsDB writes per period. */ - buildsTotal: number; + vectorsdbDatabasesWrites: Metric[]; /** - * total aggregated sum of sites build storage. + * Aggregated number of text embedding calls per period. */ - buildsStorageTotal: number; + embeddingsText: Metric; /** - * Total aggregated sum of sites build compute time. + * Aggregated number of tokens processed by text embeddings per period. */ - buildsTimeTotal: number; + embeddingsTextTokens: Metric; /** - * Total aggregated sum of sites build mbSeconds. + * Aggregated duration spent generating text embeddings per period. */ - buildsMbSecondsTotal: number; + embeddingsTextDuration: Metric; /** - * Total aggregated number of sites execution. + * Aggregated number of errors while generating text embeddings per period. */ - executionsTotal: number; + embeddingsTextErrors: Metric; /** - * Total aggregated sum of sites execution compute time. + * Total aggregated number of text embedding calls. */ - executionsTimeTotal: number; + embeddingsTextTotal: Metric; /** - * Total aggregated sum of sites execution mbSeconds. + * Total aggregated number of tokens processed by text. */ - executionsMbSecondsTotal: number; + embeddingsTextTokensTotal: Metric; /** - * Total aggregated number of requests. + * Total aggregated duration spent generating text embeddings. */ - requestsTotal: number; + embeddingsTextDurationTotal: Metric; /** - * Aggregated number of requests per period. + * Total aggregated number of errors while generating text embeddings. */ - requests: Metric[]; + embeddingsTextErrorsTotal: Metric; /** - * Total aggregated inbound bandwidth. + * Aggregated number of function executions per period. */ - inboundTotal: number; + functionsExecutions: Metric[]; /** - * Aggregated number of inbound bandwidth per period. + * Total aggregated number of function executions. */ - inbound: Metric[]; + functionsExecutionsTotal: number; /** - * Total aggregated outbound bandwidth. + * Aggregated number of site executions per period. */ - outboundTotal: number; + sitesExecutions: Metric[]; /** - * Aggregated number of outbound bandwidth per period. + * Total aggregated number of site executions. */ - outbound: Metric[]; + sitesExecutionsTotal: number; /** - * Aggregated number of sites deployment per period. + * Aggregated stats for total network bandwidth. */ - deployments: Metric[]; + networkTotal: number; /** - * Aggregated number of sites deployment storage per period. + * Aggregated stats for total backups storage. */ - deploymentsStorage: Metric[]; + backupsStorageTotal: number; /** - * Total aggregated number of successful site builds. + * An array of aggregated number of screenshots generated. */ - buildsSuccessTotal: number; + screenshotsGenerated: Metric[]; /** - * Total aggregated number of failed site builds. + * Total aggregated number of screenshots generated. */ - buildsFailedTotal: number; + screenshotsGeneratedTotal: number; /** - * Aggregated number of sites build per period. + * An array of aggregated number of Imagine credits in the given period. */ - builds: Metric[]; + imagineCredits: Metric[]; /** - * Aggregated sum of sites build storage per period. + * Total aggregated number of Imagine credits. */ - buildsStorage: Metric[]; + imagineCreditsTotal: number; /** - * Aggregated sum of sites build compute time per period. + * Current aggregated number of open Realtime connections. */ - buildsTime: Metric[]; + realtimeConnectionsTotal: number; /** - * Aggregated sum of sites build mbSeconds per period. + * Total number of Realtime messages sent to clients. */ - buildsMbSeconds: Metric[]; + realtimeMessagesTotal: number; /** - * Aggregated number of sites execution per period. + * Total consumed Realtime bandwidth (in bytes). */ - executions: Metric[]; + realtimeBandwidthTotal: number; /** - * Aggregated number of sites execution compute time per period. + * Aggregated number of open Realtime connections per period. */ - executionsTime: Metric[]; + realtimeConnections: Metric[]; /** - * Aggregated number of sites mbSeconds per period. + * Aggregated number of Realtime messages sent to clients per period. */ - executionsMbSeconds: Metric[]; + realtimeMessages: Metric[]; /** - * Aggregated number of successful site builds per period. + * Aggregated consumed Realtime bandwidth (in bytes) per period. */ - buildsSuccess: Metric[]; + realtimeBandwidth: Metric[]; + } + + /** + * Projects List + */ + export type ProjectList = { /** - * Aggregated number of failed site builds per period. + * Total number of projects that matched your query. */ - buildsFailed: Metric[]; + total: number; + /** + * List of projects. + */ + projects: Project[]; } /** - * UsageSite + * Project */ - export type UsageSite = { + export type Project = { /** - * The time range of the usage stats. + * Project ID. */ - range: string; + $id: string; /** - * Total aggregated number of function deployments. + * Project creation date in ISO 8601 format. */ - deploymentsTotal: number; + $createdAt: string; /** - * Total aggregated sum of function deployments storage. + * Project update date in ISO 8601 format. */ - deploymentsStorageTotal: number; + $updatedAt: string; /** - * Total aggregated number of function builds. + * Project name. */ - buildsTotal: number; + name: string; /** - * Total aggregated number of successful function builds. + * Project description. */ - buildsSuccessTotal: number; + description: string; /** - * Total aggregated number of failed function builds. + * Project team ID. */ - buildsFailedTotal: number; + teamId: string; /** - * total aggregated sum of function builds storage. + * Project logo file ID. */ - buildsStorageTotal: number; + logo: string; /** - * Total aggregated sum of function builds compute time. + * Project website URL. */ - buildsTimeTotal: number; + url: string; /** - * Average builds compute time. + * Company legal name. */ - buildsTimeAverage: number; + legalName: string; /** - * Total aggregated sum of function builds mbSeconds. + * Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format. */ - buildsMbSecondsTotal: number; + legalCountry: string; /** - * Total aggregated number of function executions. + * State name. */ - executionsTotal: number; + legalState: string; /** - * Total aggregated sum of function executions compute time. + * City name. */ - executionsTimeTotal: number; + legalCity: string; /** - * Total aggregated sum of function executions mbSeconds. + * Company Address. */ - executionsMbSecondsTotal: number; + legalAddress: string; /** - * Aggregated number of function deployments per period. + * Company Tax ID. */ - deployments: Metric[]; + legalTaxId: string; /** - * Aggregated number of function deployments storage per period. + * Session duration in seconds. */ - deploymentsStorage: Metric[]; + authDuration: number; /** - * Aggregated number of function builds per period. + * Max users allowed. 0 is unlimited. */ - builds: Metric[]; + authLimit: number; /** - * Aggregated sum of function builds storage per period. + * Max sessions allowed per user. 100 maximum. */ - buildsStorage: Metric[]; + authSessionsLimit: number; /** - * Aggregated sum of function builds compute time per period. + * Max allowed passwords in the history list per user. Max passwords limit allowed in history is 20. Use 0 for disabling password history. */ - buildsTime: Metric[]; + authPasswordHistory: number; /** - * Aggregated number of function builds mbSeconds per period. + * Whether or not to check user's password against most commonly used passwords. */ - buildsMbSeconds: Metric[]; + authPasswordDictionary: boolean; /** - * Aggregated number of function executions per period. + * Whether or not to check the user password for similarity with their personal data. */ - executions: Metric[]; + authPersonalDataCheck: boolean; /** - * Aggregated number of function executions compute time per period. + * An array of mock numbers and their corresponding verification codes (OTPs). */ - executionsTime: Metric[]; + authMockNumbers: MockNumber[]; /** - * Aggregated number of function mbSeconds per period. + * Whether or not to send session alert emails to users. */ - executionsMbSeconds: Metric[]; + authSessionAlerts: boolean; /** - * Aggregated number of successful builds per period. + * Whether or not to show user names in the teams membership response. */ - buildsSuccess: Metric[]; + authMembershipsUserName: boolean; /** - * Aggregated number of failed builds per period. + * Whether or not to show user emails in the teams membership response. */ - buildsFailed: Metric[]; + authMembershipsUserEmail: boolean; /** - * Total aggregated number of requests. + * Whether or not to show user MFA status in the teams membership response. */ - requestsTotal: number; + authMembershipsMfa: boolean; /** - * Aggregated number of requests per period. + * Whether or not all existing sessions should be invalidated on password change + */ + authInvalidateSessions: boolean; + /** + * List of Auth Providers. + */ + oAuthProviders: AuthProvider[]; + /** + * List of Platforms. + */ + platforms: Platform[]; + /** + * List of Webhooks. + */ + webhooks: Webhook[]; + /** + * List of API Keys. */ - requests: Metric[]; + keys: Key[]; /** - * Total aggregated inbound bandwidth. + * List of dev keys. */ - inboundTotal: number; + devKeys: DevKey[]; /** - * Aggregated number of inbound bandwidth per period. + * Status for custom SMTP */ - inbound: Metric[]; + smtpEnabled: boolean; /** - * Total aggregated outbound bandwidth. + * SMTP sender name */ - outboundTotal: number; + smtpSenderName: string; /** - * Aggregated number of outbound bandwidth per period. + * SMTP sender email */ - outbound: Metric[]; - } - - /** - * UsageProject - */ - export type UsageProject = { + smtpSenderEmail: string; /** - * Total aggregated number of function executions. + * SMTP reply to email */ - executionsTotal: number; + smtpReplyTo: string; /** - * Total aggregated number of documents in legacy/tablesdb. + * SMTP server host name */ - documentsTotal: number; + smtpHost: string; /** - * Total aggregated number of documents in documentsdb. + * SMTP server port */ - documentsdbDocumentsTotal: number; + smtpPort: number; /** - * Total aggregated number of rows. + * SMTP server username */ - rowsTotal: number; + smtpUsername: string; /** - * Total aggregated number of databases. + * SMTP server password */ - databasesTotal: number; + smtpPassword: string; /** - * Total aggregated number of documentsdb. + * SMTP server secure protocol */ - documentsdbTotal: number; + smtpSecure: string; /** - * Total aggregated sum of databases storage size (in bytes). + * Number of times the ping was received for this project. */ - databasesStorageTotal: number; + pingCount: number; /** - * Total aggregated sum of documentsdb databases storage size (in bytes). + * Last ping datetime in ISO 8601 format. */ - documentsdbDatabasesStorageTotal: number; + pingedAt: string; /** - * Total aggregated number of users. + * Labels for the project. */ - usersTotal: number; + labels: string[]; /** - * Total aggregated sum of files storage size (in bytes). + * Project status */ - filesStorageTotal: number; + status: string; /** - * Total aggregated sum of functions storage size (in bytes). + * Email/Password auth method status */ - functionsStorageTotal: number; + authEmailPassword: boolean; /** - * Total aggregated sum of builds storage size (in bytes). + * Magic URL auth method status */ - buildsStorageTotal: number; + authUsersAuthMagicURL: boolean; /** - * Total aggregated sum of deployments storage size (in bytes). + * Email (OTP) auth method status */ - deploymentsStorageTotal: number; + authEmailOtp: boolean; /** - * Total aggregated number of buckets. + * Anonymous auth method status */ - bucketsTotal: number; + authAnonymous: boolean; /** - * Total aggregated number of function executions mbSeconds. + * Invites auth method status */ - executionsMbSecondsTotal: number; + authInvites: boolean; /** - * Total aggregated number of function builds mbSeconds. + * JWT auth method status */ - buildsMbSecondsTotal: number; + authJWT: boolean; /** - * Aggregated stats for total databases reads. + * Phone auth method status */ - databasesReadsTotal: number; + authPhone: boolean; /** - * Aggregated stats for total databases writes. + * Account service status */ - databasesWritesTotal: number; + serviceStatusForAccount: boolean; /** - * Total number of documentsdb databases reads. + * Avatars service status */ - documentsdbDatabasesReadsTotal: number; + serviceStatusForAvatars: boolean; /** - * Total number of documentsdb databases writes. + * Databases (legacy) service status */ - documentsdbDatabasesWritesTotal: number; + serviceStatusForDatabases: boolean; /** - * Aggregated number of requests per period. + * TablesDB service status */ - requests: Metric[]; + serviceStatusForTablesdb: boolean; /** - * Aggregated number of consumed bandwidth per period. + * Locale service status */ - network: Metric[]; + serviceStatusForLocale: boolean; /** - * Aggregated number of users per period. + * Health service status */ - users: Metric[]; + serviceStatusForHealth: boolean; /** - * Aggregated number of executions per period. + * Storage service status */ - executions: Metric[]; + serviceStatusForStorage: boolean; /** - * Aggregated breakdown in totals of executions by functions. + * Teams service status */ - executionsBreakdown: MetricBreakdown[]; + serviceStatusForTeams: boolean; /** - * Aggregated breakdown in totals of usage by buckets. + * Users service status */ - bucketsBreakdown: MetricBreakdown[]; + serviceStatusForUsers: boolean; /** - * An array of the aggregated breakdown of storage usage by databases. + * Sites service status */ - databasesStorageBreakdown: MetricBreakdown[]; + serviceStatusForSites: boolean; /** - * Aggregated breakdown in totals of execution mbSeconds by functions. + * Functions service status */ - executionsMbSecondsBreakdown: MetricBreakdown[]; + serviceStatusForFunctions: boolean; /** - * Aggregated breakdown in totals of build mbSeconds by functions. + * GraphQL service status */ - buildsMbSecondsBreakdown: MetricBreakdown[]; + serviceStatusForGraphql: boolean; /** - * Aggregated breakdown in totals of functions storage size (in bytes). + * Messaging service status */ - functionsStorageBreakdown: MetricBreakdown[]; + serviceStatusForMessaging: boolean; /** - * Aggregated stats for total auth phone. + * Project region */ - authPhoneTotal: number; + region: string; /** - * Aggregated stats for total auth phone estimation. + * Billing limits reached */ - authPhoneEstimate: number; + billingLimits: BillingLimits; /** - * Aggregated breakdown in totals of phone auth by country. + * Project blocks information */ - authPhoneCountryBreakdown: MetricBreakdown[]; + blocks: Block[]; /** - * Aggregated stats for database reads. + * Last time the project was accessed via console. Used with plan's projectInactivityDays to determine if project is paused. */ - databasesReads: Metric[]; + consoleAccessedAt: string; + } + + /** + * Dev Keys List + */ + export type DevKeyList = { /** - * Aggregated stats for database writes. + * Total number of devKeys that matched your query. */ - databasesWrites: Metric[]; + total: number; /** - * An array of aggregated number of documentsdb database reads. + * List of devKeys. */ - documentsdbDatabasesReads: Metric[]; + devKeys: DevKey[]; + } + + /** + * DevKey + */ + export type DevKey = { /** - * An array of aggregated number of documentsdb database writes. + * Key ID. */ - documentsdbDatabasesWrites: Metric[]; + $id: string; /** - * An array of aggregated sum of documentsdb databases storage size (in bytes) per period. + * Key creation date in ISO 8601 format. */ - documentsdbDatabasesStorage: Metric[]; + $createdAt: string; /** - * An array of aggregated number of image transformations. + * Key update date in ISO 8601 format. */ - imageTransformations: Metric[]; + $updatedAt: string; /** - * Total aggregated number of image transformations. + * Key name. */ - imageTransformationsTotal: number; + name: string; /** - * Total aggregated number of VectorsDB databases. + * Key expiration date in ISO 8601 format. */ - vectorsdbDatabasesTotal: number; + expire: string; /** - * Total aggregated number of VectorsDB collections. + * Secret key. */ - vectorsdbCollectionsTotal: number; + secret: string; /** - * Total aggregated number of VectorsDB documents. + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. */ - vectorsdbDocumentsTotal: number; + accessedAt: string; /** - * Total aggregated VectorsDB storage (bytes). + * List of SDK user agents that used this key. */ - vectorsdbDatabasesStorageTotal: number; + sdks: string[]; + } + + /** + * Platforms List + */ + export type PlatformList = { /** - * Total aggregated number of VectorsDB reads. + * Total number of platforms that matched your query. */ - vectorsdbDatabasesReadsTotal: number; + total: number; /** - * Total aggregated number of VectorsDB writes. + * List of platforms. */ - vectorsdbDatabasesWritesTotal: number; + platforms: Platform[]; + } + + /** + * Platform + */ + export type Platform = { /** - * Aggregated VectorsDB databases per period. + * Platform ID. */ - vectorsdbDatabases: Metric[]; + $id: string; /** - * Aggregated VectorsDB collections per period. + * Platform creation date in ISO 8601 format. */ - vectorsdbCollections: Metric[]; + $createdAt: string; /** - * Aggregated VectorsDB documents per period. + * Platform update date in ISO 8601 format. */ - vectorsdbDocuments: Metric[]; + $updatedAt: string; /** - * Aggregated VectorsDB storage per period. + * Platform name. */ - vectorsdbDatabasesStorage: Metric[]; + name: string; /** - * Aggregated VectorsDB reads per period. + * Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android. */ - vectorsdbDatabasesReads: Metric[]; + type: PlatformType; /** - * Aggregated VectorsDB writes per period. + * Platform Key. iOS bundle ID or Android package name. Empty string for other platforms. */ - vectorsdbDatabasesWrites: Metric[]; + key: string; /** - * Aggregated number of text embedding calls per period. + * App store or Google Play store ID. */ - embeddingsText: Metric; + store: string; /** - * Aggregated number of tokens processed by text embeddings per period. + * Web app hostname. Empty string for other platforms. */ - embeddingsTextTokens: Metric; + hostname: string; /** - * Aggregated duration spent generating text embeddings per period. + * HTTP basic authentication username. */ - embeddingsTextDuration: Metric; + httpUser: string; /** - * Aggregated number of errors while generating text embeddings per period. + * HTTP basic authentication password. */ - embeddingsTextErrors: Metric; + httpPass: string; + } + + /** + * Schedules List + */ + export type ScheduleList = { /** - * Total aggregated number of text embedding calls. + * Total number of schedules that matched your query. */ - embeddingsTextTotal: Metric; + total: number; /** - * Total aggregated number of tokens processed by text. + * List of schedules. */ - embeddingsTextTokensTotal: Metric; + schedules: Schedule[]; + } + + /** + * Schedule + */ + export type Schedule = { /** - * Total aggregated duration spent generating text embeddings. + * Schedule ID. */ - embeddingsTextDurationTotal: Metric; + $id: string; /** - * Total aggregated number of errors while generating text embeddings. + * Schedule creation date in ISO 8601 format. */ - embeddingsTextErrorsTotal: Metric; + $createdAt: string; /** - * Aggregated number of function executions per period. + * Schedule update date in ISO 8601 format. */ - functionsExecutions: Metric[]; + $updatedAt: string; /** - * Total aggregated number of function executions. + * The resource type associated with this schedule. */ - functionsExecutionsTotal: number; + resourceType: string; /** - * Aggregated number of site executions per period. + * The resource ID associated with this schedule. */ - sitesExecutions: Metric[]; + resourceId: string; /** - * Total aggregated number of site executions. + * Change-tracking timestamp used by the scheduler to detect resource changes in ISO 8601 format. */ - sitesExecutionsTotal: number; + resourceUpdatedAt: string; /** - * Aggregated stats for total network bandwidth. + * The project ID associated with this schedule. */ - networkTotal: number; + projectId: string; /** - * Aggregated stats for total backups storage. + * The CRON schedule expression. */ - backupsStorageTotal: number; + schedule: string; /** - * An array of aggregated number of screenshots generated. + * Schedule data used to store resource-specific context needed for execution. */ - screenshotsGenerated: Metric[]; + data: object; /** - * Total aggregated number of screenshots generated. + * Whether the schedule is active. */ - screenshotsGeneratedTotal: number; + active: boolean; /** - * An array of aggregated number of Imagine credits in the given period. + * The region where the schedule is deployed. */ - imagineCredits: Metric[]; + region: string; + } + + /** + * EmailTemplate + */ + export type EmailTemplate = { /** - * Total aggregated number of Imagine credits. + * Template type */ - imagineCreditsTotal: number; + type: string; /** - * Current aggregated number of open Realtime connections. + * Template locale */ - realtimeConnectionsTotal: number; + locale: string; /** - * Total number of Realtime messages sent to clients. + * Template message */ - realtimeMessagesTotal: number; + message: string; /** - * Total consumed Realtime bandwidth (in bytes). + * Name of the sender */ - realtimeBandwidthTotal: number; + senderName: string; /** - * Aggregated number of open Realtime connections per period. + * Email of the sender */ - realtimeConnections: Metric[]; + senderEmail: string; /** - * Aggregated number of Realtime messages sent to clients per period. + * Reply to email address */ - realtimeMessages: Metric[]; + replyTo: string; /** - * Aggregated consumed Realtime bandwidth (in bytes) per period. + * Email subject */ - realtimeBandwidth: Metric[]; + subject: string; } /** - * Headers + * SmsTemplate */ - export type Headers = { + export type SmsTemplate = { /** - * Header name. + * Template type */ - name: string; + type: string; /** - * Header value. + * Template locale */ - value: string; + locale: string; + /** + * Template message + */ + message: string; } /** - * Specification + * Rule List */ - export type Specification = { - /** - * Memory size in MB. - */ - memory: number; - /** - * Number of CPUs. - */ - cpus: number; + export type ProxyRuleList = { /** - * Is size enabled. + * Total number of rules that matched your query. */ - enabled: boolean; + total: number; /** - * Size slug. + * List of rules. */ - slug: string; + rules: ProxyRule[]; } /** @@ -6792,2167 +6057,2376 @@ export namespace Models { } /** - * Schedule + * Sites List */ - export type Schedule = { + export type SiteList = { /** - * Schedule ID. + * Total number of sites that matched your query. + */ + total: number; + /** + * List of sites. + */ + sites: Site[]; + } + + /** + * Site + */ + export type Site = { + /** + * Site ID. */ $id: string; /** - * Schedule creation date in ISO 8601 format. + * Site creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Site update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Site name. + */ + name: string; + /** + * Site enabled. + */ + enabled: boolean; + /** + * Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration. + */ + live: boolean; + /** + * When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. + */ + logging: boolean; + /** + * Site framework. + */ + framework: string; + /** + * How many days to keep the non-active deployments before they will be automatically deleted. + */ + deploymentRetention: number; + /** + * Site's active deployment ID. + */ + deploymentId: string; + /** + * Active deployment creation date in ISO 8601 format. + */ + deploymentCreatedAt: string; + /** + * Screenshot of active deployment with light theme preference file ID. + */ + deploymentScreenshotLight: string; + /** + * Screenshot of active deployment with dark theme preference file ID. + */ + deploymentScreenshotDark: string; + /** + * Site's latest deployment ID. + */ + latestDeploymentId: string; + /** + * Latest deployment creation date in ISO 8601 format. + */ + latestDeploymentCreatedAt: string; + /** + * Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed". + */ + latestDeploymentStatus: string; + /** + * Site variables. + */ + vars: Variable[]; + /** + * Site request timeout in seconds. + */ + timeout: number; + /** + * The install command used to install the site dependencies. + */ + installCommand: string; + /** + * The build command used to build the site. + */ + buildCommand: string; + /** + * Custom command to use when starting site runtime. + */ + startCommand: string; + /** + * The directory where the site build output is located. + */ + outputDirectory: string; + /** + * Site VCS (Version Control System) installation id. */ - $createdAt: string; + installationId: string; /** - * Schedule update date in ISO 8601 format. + * VCS (Version Control System) Repository ID */ - $updatedAt: string; + providerRepositoryId: string; /** - * The resource type associated with this schedule. + * VCS (Version Control System) branch name */ - resourceType: string; + providerBranch: string; /** - * The resource ID associated with this schedule. + * Path to site in VCS (Version Control System) repository */ - resourceId: string; + providerRootDirectory: string; /** - * Change-tracking timestamp used by the scheduler to detect resource changes in ISO 8601 format. + * 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 */ - resourceUpdatedAt: string; + providerSilentMode: boolean; /** - * The project ID associated with this schedule. + * Machine specification for deployment builds. */ - projectId: string; + buildSpecification: string; /** - * The CRON schedule expression. + * Machine specification for SSR executions. */ - schedule: string; + runtimeSpecification: string; /** - * Schedule data used to store resource-specific context needed for execution. + * Site build runtime. */ - data: object; + buildRuntime: string; /** - * Whether the schedule is active. + * Site framework adapter. */ - active: boolean; + adapter: string; /** - * The region where the schedule is deployed. + * Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. */ - region: string; + fallbackFile: string; } /** - * SmsTemplate + * Frameworks List */ - export type SmsTemplate = { + export type FrameworkList = { /** - * Template type + * Total number of frameworks that matched your query. */ - type: string; + total: number; /** - * Template locale + * List of frameworks. */ - locale: string; + frameworks: Framework[]; + } + + /** + * Site Templates List + */ + export type TemplateSiteList = { /** - * Template message + * Total number of templates that matched your query. */ - message: string; + total: number; + /** + * List of templates. + */ + templates: TemplateSite[]; } /** - * EmailTemplate + * Template Site */ - export type EmailTemplate = { + export type TemplateSite = { /** - * Template type + * Site Template ID. */ - type: string; + key: string; /** - * Template locale + * Site Template Name. */ - locale: string; + name: string; /** - * Template message + * Short description of template */ - message: string; + tagline: string; /** - * Name of the sender + * URL hosting a template demo. */ - senderName: string; + demoUrl: string; /** - * Email of the sender + * File URL with preview screenshot in dark theme preference. */ - senderEmail: string; + screenshotDark: string; /** - * Reply to email address + * File URL with preview screenshot in light theme preference. */ - replyTo: string; + screenshotLight: string; /** - * Email subject + * Site use cases. */ - subject: string; - } - - /** - * Console Variables - */ - export type ConsoleVariables = { + useCases: string[]; /** - * CNAME target for your Appwrite custom domains. + * List of frameworks that can be used with this template. */ - _APP_DOMAIN_TARGET_CNAME: string; + frameworks: TemplateFramework[]; /** - * A target for your Appwrite custom domains. + * VCS (Version Control System) Provider. */ - _APP_DOMAIN_TARGET_A: string; + vcsProvider: string; /** - * Maximum build timeout in seconds. + * VCS (Version Control System) Repository ID */ - _APP_COMPUTE_BUILD_TIMEOUT: number; + providerRepositoryId: string; /** - * AAAA target for your Appwrite custom domains. + * VCS (Version Control System) Owner. */ - _APP_DOMAIN_TARGET_AAAA: string; + providerOwner: string; /** - * CAA target for your Appwrite custom domains. + * VCS (Version Control System) branch version (tag). */ - _APP_DOMAIN_TARGET_CAA: string; + providerVersion: string; /** - * Maximum file size allowed for file upload in bytes. + * Site variables. */ - _APP_STORAGE_LIMIT: number; + variables: TemplateVariable[]; + } + + /** + * UsageSites + */ + export type UsageSites = { /** - * Maximum file size allowed for deployment in bytes. + * Time range of the usage stats. */ - _APP_COMPUTE_SIZE_LIMIT: number; + range: string; /** - * Defines if usage stats are enabled. This value is set to 'enabled' by default, to disable the usage stats set the value to 'disabled'. + * Total aggregated number of sites. */ - _APP_USAGE_STATS: string; + sitesTotal: number; /** - * Defines if VCS (Version Control System) is enabled. + * Aggregated number of sites per period. */ - _APP_VCS_ENABLED: boolean; + sites: Metric[]; /** - * Defines if main domain is configured. If so, custom domains can be created. + * Total aggregated number of sites deployments. */ - _APP_DOMAIN_ENABLED: boolean; + deploymentsTotal: number; /** - * Defines if AI assistant is enabled. + * Total aggregated sum of sites deployment storage. */ - _APP_ASSISTANT_ENABLED: boolean; + deploymentsStorageTotal: number; /** - * A comma separated list of domains to use for site URLs. + * Total aggregated number of sites build. */ - _APP_DOMAIN_SITES: string; + buildsTotal: number; /** - * A domain to use for function URLs. + * total aggregated sum of sites build storage. */ - _APP_DOMAIN_FUNCTIONS: string; + buildsStorageTotal: number; /** - * Defines if HTTPS is enforced for all requests. + * Total aggregated sum of sites build compute time. */ - _APP_OPTIONS_FORCE_HTTPS: string; + buildsTimeTotal: number; /** - * Comma-separated list of nameservers. + * Total aggregated sum of sites build mbSeconds. */ - _APP_DOMAINS_NAMESERVERS: string; + buildsMbSecondsTotal: number; /** - * Database adapter in use. + * Total aggregated number of sites execution. */ - _APP_DB_ADAPTER: string; + executionsTotal: number; /** - * Whether the database adapter supports relationships. + * Total aggregated sum of sites execution compute time. */ - supportForRelationships: boolean; + executionsTimeTotal: number; /** - * Whether the database adapter supports operators. + * Total aggregated sum of sites execution mbSeconds. */ - supportForOperators: boolean; + executionsMbSecondsTotal: number; /** - * Whether the database adapter supports spatial attributes. + * Total aggregated number of requests. */ - supportForSpatials: boolean; + requestsTotal: number; /** - * Whether the database adapter supports spatial indexes on nullable columns. + * Aggregated number of requests per period. */ - supportForSpatialIndexNull: boolean; + requests: Metric[]; /** - * Whether the database adapter supports fulltext wildcard search. + * Total aggregated inbound bandwidth. */ - supportForFulltextWildcard: boolean; + inboundTotal: number; /** - * Whether the database adapter supports multiple fulltext indexes per collection. + * Aggregated number of inbound bandwidth per period. */ - supportForMultipleFulltextIndexes: boolean; + inbound: Metric[]; /** - * Whether the database adapter supports resizing attributes. + * Total aggregated outbound bandwidth. */ - supportForAttributeResizing: boolean; + outboundTotal: number; /** - * Whether the database adapter supports fixed schemas with row width limits. + * Aggregated number of outbound bandwidth per period. */ - supportForSchemas: boolean; + outbound: Metric[]; /** - * Maximum index length supported by the database adapter. + * Aggregated number of sites deployment per period. */ - maxIndexLength: number; + deployments: Metric[]; /** - * Whether the database adapter uses integer sequence IDs. + * Aggregated number of sites deployment storage per period. */ - supportForIntegerIds: boolean; - } - - /** - * MFA Challenge - */ - export type MfaChallenge = { + deploymentsStorage: Metric[]; /** - * Token ID. + * Total aggregated number of successful site builds. */ - $id: string; + buildsSuccessTotal: number; /** - * Token creation date in ISO 8601 format. + * Total aggregated number of failed site builds. */ - $createdAt: string; + buildsFailedTotal: number; /** - * User ID. + * Aggregated number of sites build per period. */ - userId: string; + builds: Metric[]; /** - * Token expiration date in ISO 8601 format. + * Aggregated sum of sites build storage per period. */ - expire: string; - } - - /** - * MFA Recovery Codes - */ - export type MfaRecoveryCodes = { + buildsStorage: Metric[]; /** - * Recovery codes. + * Aggregated sum of sites build compute time per period. */ - recoveryCodes: string[]; - } - - /** - * MFAType - */ - export type MfaType = { + buildsTime: Metric[]; /** - * Secret token used for TOTP factor. + * Aggregated sum of sites build mbSeconds per period. */ - secret: string; + buildsMbSeconds: Metric[]; /** - * URI for authenticator apps. + * Aggregated number of sites execution per period. */ - uri: string; - } - - /** - * MFAFactors - */ - export type MfaFactors = { + executions: Metric[]; /** - * Can TOTP be used for MFA challenge for this account. + * Aggregated number of sites execution compute time per period. */ - totp: boolean; + executionsTime: Metric[]; /** - * Can phone (SMS) be used for MFA challenge for this account. + * Aggregated number of sites mbSeconds per period. */ - phone: boolean; + executionsMbSeconds: Metric[]; /** - * Can email be used for MFA challenge for this account. + * Aggregated number of successful site builds per period. */ - email: boolean; + buildsSuccess: Metric[]; /** - * Can recovery code be used for MFA challenge for this account. + * Aggregated number of failed site builds per period. */ - recoveryCode: boolean; + buildsFailed: Metric[]; } /** - * Provider + * UsageSite */ - export type Provider = { + export type UsageSite = { /** - * Provider ID. + * The time range of the usage stats. */ - $id: string; + range: string; /** - * Provider creation time in ISO 8601 format. + * Total aggregated number of function deployments. */ - $createdAt: string; + deploymentsTotal: number; /** - * Provider update date in ISO 8601 format. + * Total aggregated sum of function deployments storage. */ - $updatedAt: string; + deploymentsStorageTotal: number; /** - * The name for the provider instance. + * Total aggregated number of function builds. */ - name: string; + buildsTotal: number; /** - * The name of the provider service. + * Total aggregated number of successful function builds. */ - provider: string; + buildsSuccessTotal: number; /** - * Is provider enabled? + * Total aggregated number of failed function builds. */ - enabled: boolean; + buildsFailedTotal: number; /** - * Type of provider. + * total aggregated sum of function builds storage. */ - type: string; + buildsStorageTotal: number; /** - * Provider credentials. + * Total aggregated sum of function builds compute time. */ - credentials: object; + buildsTimeTotal: number; /** - * Provider options. + * Average builds compute time. */ - options?: object; - } - - /** - * Message - */ - export type Message = { + buildsTimeAverage: number; /** - * Message ID. + * Total aggregated sum of function builds mbSeconds. */ - $id: string; + buildsMbSecondsTotal: number; /** - * Message creation time in ISO 8601 format. + * Total aggregated number of function executions. */ - $createdAt: string; + executionsTotal: number; /** - * Message update date in ISO 8601 format. + * Total aggregated sum of function executions compute time. */ - $updatedAt: string; + executionsTimeTotal: number; /** - * Message provider type. + * Total aggregated sum of function executions mbSeconds. */ - providerType: string; + executionsMbSecondsTotal: number; /** - * Topic IDs set as recipients. + * Aggregated number of function deployments per period. */ - topics: string[]; + deployments: Metric[]; /** - * User IDs set as recipients. + * Aggregated number of function deployments storage per period. */ - users: string[]; + deploymentsStorage: Metric[]; /** - * Target IDs set as recipients. + * Aggregated number of function builds per period. */ - targets: string[]; + builds: Metric[]; /** - * The scheduled time for message. + * Aggregated sum of function builds storage per period. */ - scheduledAt?: string; + buildsStorage: Metric[]; /** - * The time when the message was delivered. + * Aggregated sum of function builds compute time per period. */ - deliveredAt?: string; + buildsTime: Metric[]; /** - * Delivery errors if any. + * Aggregated number of function builds mbSeconds per period. */ - deliveryErrors?: string[]; + buildsMbSeconds: Metric[]; /** - * Number of recipients the message was delivered to. + * Aggregated number of function executions per period. */ - deliveredTotal: number; + executions: Metric[]; /** - * Data of the message. + * Aggregated number of function executions compute time per period. */ - data: object; + executionsTime: Metric[]; /** - * Status of delivery. + * Aggregated number of function mbSeconds per period. */ - status: MessageStatus; - } - - /** - * Topic - */ - export type Topic = { + executionsMbSeconds: Metric[]; /** - * Topic ID. + * Aggregated number of successful builds per period. */ - $id: string; + buildsSuccess: Metric[]; /** - * Topic creation time in ISO 8601 format. + * Aggregated number of failed builds per period. */ - $createdAt: string; + buildsFailed: Metric[]; /** - * Topic update date in ISO 8601 format. + * Total aggregated number of requests. */ - $updatedAt: string; + requestsTotal: number; /** - * The name of the topic. + * Aggregated number of requests per period. */ - name: string; + requests: Metric[]; /** - * Total count of email subscribers subscribed to the topic. + * Total aggregated inbound bandwidth. */ - emailTotal: number; + inboundTotal: number; /** - * Total count of SMS subscribers subscribed to the topic. + * Aggregated number of inbound bandwidth per period. */ - smsTotal: number; + inbound: Metric[]; /** - * Total count of push subscribers subscribed to the topic. + * Total aggregated outbound bandwidth. */ - pushTotal: number; + outboundTotal: number; /** - * Subscribe permissions. + * Aggregated number of outbound bandwidth per period. */ - subscribe: string[]; + outbound: Metric[]; } /** - * Transaction + * Buckets List */ - export type Transaction = { - /** - * Transaction ID. - */ - $id: string; - /** - * Transaction creation time in ISO 8601 format. - */ - $createdAt: string; - /** - * Transaction update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Current status of the transaction. One of: pending, committing, committed, rolled_back, failed. - */ - status: string; + export type BucketList = { /** - * Number of operations in the transaction. + * Total number of buckets that matched your query. */ - operations: number; + total: number; /** - * Expiration time in ISO 8601 format. + * List of buckets. */ - expiresAt: string; + buckets: Bucket[]; } /** - * Subscriber + * Bucket */ - export type Subscriber = { + export type Bucket = { /** - * Subscriber ID. + * Bucket ID. */ $id: string; /** - * Subscriber creation time in ISO 8601 format. + * Bucket creation time in ISO 8601 format. */ $createdAt: string; /** - * Subscriber update date in ISO 8601 format. + * Bucket update date in ISO 8601 format. */ $updatedAt: string; /** - * Target ID. - */ - targetId: string; - /** - * Target. - */ - target: Target; - /** - * Topic ID. + * Bucket permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ - userId: string; + $permissions: string[]; /** - * User Name. + * Whether file-level security is enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). */ - userName: string; + fileSecurity: boolean; /** - * Topic ID. + * Bucket name. */ - topicId: string; + name: string; /** - * The target provider type. Can be one of the following: `email`, `sms` or `push`. + * Bucket enabled. */ - providerType: string; - } - - /** - * Target - */ - export type Target = { + enabled: boolean; /** - * Target ID. + * Maximum file size supported. */ - $id: string; + maximumFileSize: number; /** - * Target creation time in ISO 8601 format. + * Allowed file extensions. */ - $createdAt: string; + allowedFileExtensions: string[]; /** - * Target update date in ISO 8601 format. + * Compression algorithm chosen for compression. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd). */ - $updatedAt: string; + compression: string; /** - * Target Name. + * Bucket is encrypted. */ - name: string; + encryption: boolean; /** - * User ID. + * Virus scanning is enabled. */ - userId: string; + antivirus: boolean; /** - * Provider ID. + * Image transformations are enabled. */ - providerId?: string; + transformations: boolean; /** - * The target provider type. Can be one of the following: `email`, `sms` or `push`. + * Total size of this bucket in bytes. */ - providerType: string; + totalSize: number; + } + + /** + * Files List + */ + export type FileList = { /** - * The target identifier. + * Total number of files that matched your query. */ - identifier: string; + total: number; /** - * Is the target expired. + * List of files. */ - expired: boolean; + files: File[]; } /** - * Migration + * File */ - export type Migration = { + export type File = { /** - * Migration ID. + * File ID. */ $id: string; /** - * Migration creation date in ISO 8601 format. + * Bucket ID. */ - $createdAt: string; + bucketId: string; /** - * Variable creation date in ISO 8601 format. + * File creation date in ISO 8601 format. */ - $updatedAt: string; + $createdAt: string; /** - * Migration status ( pending, processing, failed, completed ) + * File update date in ISO 8601 format. */ - status: string; + $updatedAt: string; /** - * Migration stage ( init, processing, source-check, destination-check, migrating, finished ) + * File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ - stage: string; + $permissions: string[]; /** - * A string containing the type of source of the migration. + * File name. */ - source: string; + name: string; /** - * A string containing the type of destination of the migration. + * File MD5 signature. */ - destination: string; + signature: string; /** - * Resources to migrate. + * File mime type. */ - resources: string[]; + mimeType: string; /** - * Id of the resource to migrate. + * File original size in bytes. */ - resourceId: string; + sizeOriginal: number; /** - * A group of counters that represent the total progress of the migration. + * Total number of chunks available */ - statusCounters: object; + chunksTotal: number; /** - * An array of objects containing the report data of the resources that were migrated. + * Total number of chunks uploaded */ - resourceData: object; + chunksUploaded: number; /** - * All errors that occurred during the migration process. + * Whether file contents are encrypted at rest. */ - errors: string[]; + encryption: boolean; /** - * Migration options used during the migration process. + * Compression algorithm used for the file. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd). */ - options: object; + compression: string; } /** - * Migration Report + * StorageUsage */ - export type MigrationReport = { - /** - * Number of users to be migrated. - */ - user: number; - /** - * Number of teams to be migrated. - */ - team: number; - /** - * Number of databases to be migrated. - */ - database: number; - /** - * Number of rows to be migrated. - */ - row: number; - /** - * Number of files to be migrated. - */ - file: number; - /** - * Number of buckets to be migrated. - */ - bucket: number; - /** - * Number of functions to be migrated. - */ - function: number; + export type UsageStorage = { /** - * Number of sites to be migrated. + * Time range of the usage stats. */ - site: number; + range: string; /** - * Number of providers to be migrated. + * Total aggregated number of buckets */ - provider: number; + bucketsTotal: number; /** - * Number of topics to be migrated. + * Total aggregated number of files. */ - topic: number; + filesTotal: number; /** - * Number of subscribers to be migrated. + * Total aggregated number of files storage (in bytes). */ - subscriber: number; + filesStorageTotal: number; /** - * Number of messages to be migrated. + * Aggregated number of buckets per period. */ - message: number; + buckets: Metric[]; /** - * Size of files to be migrated in mb. + * Aggregated number of files per period. */ - size: number; + files: Metric[]; /** - * Version of the Appwrite instance to be migrated. + * Aggregated number of files storage (in bytes) per period . */ - version: string; + storage: Metric[]; } /** - * ActivityEvent + * UsageBuckets */ - export type ActivityEvent = { - /** - * Event ID. - */ - $id: string; - /** - * User type. - */ - userType: string; + export type UsageBuckets = { /** - * User ID. + * Time range of the usage stats. */ - userId: string; + range: string; /** - * User Email. + * Total aggregated number of bucket files. */ - userEmail: string; + filesTotal: number; /** - * User Name. + * Total aggregated number of bucket files storage (in bytes). */ - userName: string; + filesStorageTotal: number; /** - * Resource parent. + * Aggregated number of bucket files per period. */ - resourceParent: string; + files: Metric[]; /** - * Resource type. + * Aggregated number of bucket storage files (in bytes) per period. */ - resourceType: string; + storage: Metric[]; /** - * Resource ID. + * Aggregated number of files transformations per period. */ - resourceId: string; + imageTransformations: Metric[]; /** - * Resource. + * Total aggregated number of files transformations. */ - resource: string; + imageTransformationsTotal: number; + } + + /** + * Tables List + */ + export type TableList = { /** - * Event name. + * Total number of tables that matched your query. */ - event: string; + total: number; /** - * User agent. + * List of tables. */ - userAgent: string; + tables: Table[]; + } + + /** + * Table + */ + export type Table = { /** - * IP address. + * Table ID. */ - ip: string; + $id: string; /** - * API mode when event triggered. + * Table creation date in ISO 8601 format. */ - mode: string; + $createdAt: string; /** - * Location. + * Table update date in ISO 8601 format. */ - country: string; + $updatedAt: string; /** - * Log creation date in ISO 8601 format. + * Table permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ - time: string; + $permissions: string[]; /** - * Project ID. + * Database ID. */ - projectId: string; + databaseId: string; /** - * Team ID. + * Table name. */ - teamId: string; + name: string; /** - * Hostname. + * Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys. */ - hostname: string; + enabled: boolean; /** - * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). + * Whether row-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). */ - osCode: string; + rowSecurity: boolean; /** - * Operating system name. + * Table columns. */ - osName: string; + columns: (Models.ColumnBoolean | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail | Models.ColumnEnum | Models.ColumnUrl | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship | Models.ColumnPoint | Models.ColumnLine | Models.ColumnPolygon | Models.ColumnVarchar | Models.ColumnText | Models.ColumnMediumtext | Models.ColumnLongtext | Models.ColumnString)[]; /** - * Operating system version. + * Table indexes. */ - osVersion: string; + indexes: ColumnIndex[]; /** - * Client type. + * Maximum row size in bytes. Returns 0 when no limit applies. */ - clientType: string; + bytesMax: number; /** - * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). + * Currently used row size in bytes based on defined columns. */ - clientCode: string; + bytesUsed: number; + } + + /** + * ColumnBoolean + */ + export type ColumnBoolean = { /** - * Client name. + * Column Key. */ - clientName: string; + key: string; /** - * Client version. + * Column type. */ - clientVersion: string; + type: string; /** - * Client engine name. + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - clientEngine: string; + status: ColumnStatus; /** - * Client engine name. + * Error message. Displays error generated on failure of creating or deleting an column. */ - clientEngineVersion: string; + error: string; /** - * Device name. + * Is column required? */ - deviceName: string; + required: boolean; /** - * Device brand name. + * Is column an array? */ - deviceBrand: string; + array?: boolean; /** - * Device model name. + * Column creation date in ISO 8601 format. */ - deviceModel: string; + $createdAt: string; /** - * Country two-character ISO 3166-1 alpha code. + * Column update date in ISO 8601 format. */ - countryCode: string; + $updatedAt: string; /** - * Country name. + * Default value for column when not provided. Cannot be set when column is required. */ - countryName: string; + default?: boolean; } /** - * AdditionalResource + * ColumnDatetime */ - export type AdditionalResource = { - /** - * Resource name - */ - name: string; + export type ColumnDatetime = { /** - * Resource unit + * Column Key. */ - unit: string; + key: string; /** - * Price currency + * Column type. */ - currency: string; + type: string; /** - * Price + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - price: number; + status: ColumnStatus; /** - * Resource value + * Error message. Displays error generated on failure of creating or deleting an column. */ - value: number; + error: string; /** - * Description on invoice + * Is column required? */ - invoiceDesc: string; - } - - /** - * AggregationTeam - */ - export type AggregationTeam = { + required: boolean; /** - * Aggregation ID. + * Is column an array? */ - $id: string; + array?: boolean; /** - * Aggregation creation time in ISO 8601 format. + * Column creation date in ISO 8601 format. */ $createdAt: string; /** - * Aggregation update date in ISO 8601 format. + * Column update date in ISO 8601 format. */ $updatedAt: string; /** - * Aggregation permissions. [Learn more about permissions](/docs/permissions). + * ISO 8601 format. */ - $permissions: string[]; + format: string; /** - * Beginning date of the invoice + * Default value for column when not provided. Only null is optional */ - from: string; + default?: string; + } + + /** + * ColumnEmail + */ + export type ColumnEmail = { /** - * End date of the invoice + * Column Key. */ - to: string; + key: string; /** - * Total storage usage + * Column type. */ - usageStorage: number; + type: string; /** - * Total storage usage with builds storage + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - usageTotalStorage: number; + status: ColumnStatus; /** - * Total files storage usage + * Error message. Displays error generated on failure of creating or deleting an column. */ - usageFilesStorage: number; + error: string; /** - * Total deployments storage usage + * Is column required? */ - usageDeploymentsStorage: number; + required: boolean; /** - * Total builds storage usage + * Is column an array? */ - usageBuildsStorage: number; + array?: boolean; /** - * Total databases storage usage + * Column creation date in ISO 8601 format. */ - usageDatabasesStorage: number; + $createdAt: string; /** - * Total active users for the billing period + * Column update date in ISO 8601 format. */ - usageUsers: number; + $updatedAt: string; /** - * Total number of executions for the billing period + * String format. */ - usageExecutions: number; + format: string; /** - * Total bandwidth usage for the billing period + * Default value for column when not provided. Cannot be set when column is required. */ - usageBandwidth: number; + default?: string; + } + + /** + * ColumnEnum + */ + export type ColumnEnum = { /** - * Peak concurrent realtime connections for the billing period + * Column Key. */ - usageRealtime: number; + key: string; /** - * Total realtime messages sent for the billing period + * Column type. */ - usageRealtimeMessages: number; + type: string; /** - * Total realtime bandwidth usage for the billing period + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - usageRealtimeBandwidth: number; + status: ColumnStatus; /** - * Additional members + * Error message. Displays error generated on failure of creating or deleting an column. */ - additionalMembers: number; + error: string; /** - * Additional members cost + * Is column required? */ - additionalMemberAmount: number; + required: boolean; /** - * Additional storage usage cost + * Is column an array? */ - additionalStorageAmount: number; + array?: boolean; /** - * Additional users usage cost. + * Column creation date in ISO 8601 format. */ - additionalUsersAmount: number; + $createdAt: string; /** - * Additional executions usage cost + * Column update date in ISO 8601 format. */ - additionalExecutionsAmount: number; + $updatedAt: string; /** - * Additional bandwidth usage cost + * Array of elements in enumerated type. */ - additionalBandwidthAmount: number; + elements: string[]; /** - * Additional realtime usage cost + * String format. */ - additionalRealtimeAmount: number; + format: string; /** - * Billing plan + * Default value for column when not provided. Cannot be set when column is required. */ - plan: string; + default?: string; + } + + /** + * ColumnFloat + */ + export type ColumnFloat = { /** - * Aggregated amount + * Column Key. */ - amount: number; + key: string; /** - * Aggregation project breakdown + * Column type. */ - breakdown: AggregationBreakdown[]; + type: string; /** - * Usage resources + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - resources: UsageResources[]; - } - - /** - * AggregationBreakdown - */ - export type AggregationBreakdown = { + status: ColumnStatus; /** - * Aggregation ID. + * Error message. Displays error generated on failure of creating or deleting an column. */ - $id: string; + error: string; /** - * Project name + * Is column required? */ - name: string; + required: boolean; /** - * Project region + * Is column an array? */ - region: string; + array?: boolean; /** - * Aggregated amount + * Column creation date in ISO 8601 format. */ - amount: number; + $createdAt: string; /** - * + * Column update date in ISO 8601 format. */ - resources: UsageResources[]; + $updatedAt: string; + /** + * Minimum value to enforce for new documents. + */ + min?: number; + /** + * Maximum value to enforce for new documents. + */ + max?: number; + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + default?: number; } /** - * Archive + * ColumnInteger */ - export type BackupArchive = { - /** - * Archive ID. - */ - $id: string; + export type ColumnInteger = { /** - * Archive creation time in ISO 8601 format. + * Column Key. */ - $createdAt: string; + key: string; /** - * Archive update date in ISO 8601 format. + * Column type. */ - $updatedAt: string; + type: string; /** - * Archive policy ID. + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - policyId: string; + status: ColumnStatus; /** - * Archive size in bytes. + * Error message. Displays error generated on failure of creating or deleting an column. */ - size: number; + error: string; /** - * The status of the archive creation. Possible values: pending, processing, uploading, completed, failed. + * Is column required? */ - status: string; + required: boolean; /** - * The backup start time. + * Is column an array? */ - startedAt: string; + array?: boolean; /** - * Migration ID. + * Column creation date in ISO 8601 format. */ - migrationId: string; + $createdAt: string; /** - * The services that are backed up by this archive. + * Column update date in ISO 8601 format. */ - services: string[]; + $updatedAt: string; /** - * The resources that are backed up by this archive. + * Minimum value to enforce for new documents. */ - resources: string[]; + min?: number | bigint; /** - * The resource ID to backup. Set only if this archive should backup a single resource. + * Maximum value to enforce for new documents. */ - resourceId?: string; + max?: number | bigint; /** - * The resource type to backup. Set only if this archive should backup a single resource. + * Default value for column when not provided. Cannot be set when column is required. */ - resourceType?: string; + default?: number; } /** - * BillingAddress + * ColumnIP */ - export type BillingAddress = { + export type ColumnIp = { /** - * Region ID + * Column Key. */ - $id: string; + key: string; /** - * User ID + * Column type. */ - userId: string; + type: string; /** - * Street address + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - streetAddress: string; + status: ColumnStatus; /** - * Address line 2 + * Error message. Displays error generated on failure of creating or deleting an column. */ - addressLine2: string; + error: string; /** - * Address country + * Is column required? */ - country: string; + required: boolean; /** - * city + * Is column an array? */ - city: string; + array?: boolean; /** - * state + * Column creation date in ISO 8601 format. */ - state: string; + $createdAt: string; /** - * postal code + * Column update date in ISO 8601 format. */ - postalCode: string; + $updatedAt: string; + /** + * String format. + */ + format: string; + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + default?: string; } /** - * billingPlan + * ColumnLine */ - export type BillingPlan = { + export type ColumnLine = { /** - * Plan ID. + * Column Key. */ - $id: string; + key: string; /** - * Plan name + * Column type. */ - name: string; + type: string; /** - * Plan description + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - desc: string; + status: ColumnStatus; /** - * Plan order + * Error message. Displays error generated on failure of creating or deleting an column. */ - order: number; + error: string; /** - * Price + * Is column required? */ - price: number; + required: boolean; /** - * Trial days + * Is column an array? */ - trial: number; + array?: boolean; /** - * Bandwidth + * Column creation date in ISO 8601 format. */ - bandwidth: number; + $createdAt: string; /** - * Storage + * Column update date in ISO 8601 format. */ - storage: number; + $updatedAt: string; /** - * Image Transformations + * Default value for column when not provided. Cannot be set when column is required. */ - imageTransformations: number; + default?: any[]; + } + + /** + * ColumnLongtext + */ + export type ColumnLongtext = { /** - * Screenshots generated + * Column Key. */ - screenshotsGenerated: number; + key: string; /** - * Members + * Column type. */ - members: number; + type: string; /** - * Webhooks + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - webhooks: number; + status: ColumnStatus; /** - * Projects + * Error message. Displays error generated on failure of creating or deleting an column. */ - projects: number; + error: string; /** - * Platforms + * Is column required? */ - platforms: number; + required: boolean; /** - * Users + * Is column an array? */ - users: number; + array?: boolean; /** - * Teams + * Column creation date in ISO 8601 format. */ - teams: number; + $createdAt: string; /** - * Databases + * Column update date in ISO 8601 format. */ - databases: number; + $updatedAt: string; /** - * Database reads per month + * Default value for column when not provided. Cannot be set when column is required. */ - databasesReads: number; + default?: string; /** - * Database writes per month + * Defines whether this column is encrypted or not. */ - databasesWrites: number; + encrypt?: boolean; + } + + /** + * ColumnMediumtext + */ + export type ColumnMediumtext = { /** - * Database batch size limit + * Column Key. */ - databasesBatchSize: number; + key: string; /** - * Buckets + * Column type. */ - buckets: number; + type: string; /** - * File size + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - fileSize: number; + status: ColumnStatus; /** - * Functions + * Error message. Displays error generated on failure of creating or deleting an column. */ - functions: number; + error: string; /** - * Sites + * Is column required? */ - sites: number; + required: boolean; /** - * Function executions + * Is column an array? */ - executions: number; + array?: boolean; /** - * Rolling max executions retained per function/site + * Column creation date in ISO 8601 format. */ - executionsRetentionCount: number; + $createdAt: string; /** - * GB hours for functions + * Column update date in ISO 8601 format. */ - GBHours: number; + $updatedAt: string; /** - * Realtime connections + * Default value for column when not provided. Cannot be set when column is required. */ - realtime: number; + default?: string; /** - * Realtime messages + * Defines whether this column is encrypted or not. */ - realtimeMessages: number; + encrypt?: boolean; + } + + /** + * ColumnPoint + */ + export type ColumnPoint = { /** - * Messages per month + * Column Key. */ - messages: number; + key: string; /** - * Topics for messaging + * Column type. */ - topics: number; + type: string; /** - * SMS authentications per month + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - authPhone: number; + status: ColumnStatus; /** - * Custom domains + * Error message. Displays error generated on failure of creating or deleting an column. */ - domains: number; + error: string; /** - * Log days + * Is column required? */ - logs: number; + required: boolean; /** - * Number of days of console inactivity before a project is paused. 0 means pausing is disabled. + * Is column an array? */ - projectInactivityDays: number; + array?: boolean; /** - * Alert threshold percentage + * Column creation date in ISO 8601 format. */ - alertLimit: number; + $createdAt: string; /** - * Additional resources + * Column update date in ISO 8601 format. */ - usage: UsageBillingPlan; + $updatedAt: string; /** - * Addons + * Default value for column when not provided. Cannot be set when column is required. */ - addons: BillingPlanAddon; + default?: any[]; + } + + /** + * ColumnPolygon + */ + export type ColumnPolygon = { /** - * Budget cap enabled or disabled. + * Column Key. */ - budgetCapEnabled: boolean; + key: string; + /** + * Column type. + */ + type: string; + /** + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + */ + status: ColumnStatus; /** - * Custom SMTP + * Error message. Displays error generated on failure of creating or deleting an column. */ - customSmtp: boolean; + error: string; /** - * Appwrite branding in email + * Is column required? */ - emailBranding: boolean; + required: boolean; /** - * Does plan require payment method + * Is column an array? */ - requiresPaymentMethod: boolean; + array?: boolean; /** - * Does plan require billing address + * Column creation date in ISO 8601 format. */ - requiresBillingAddress: boolean; + $createdAt: string; /** - * Is the billing plan available + * Column update date in ISO 8601 format. */ - isAvailable: boolean; + $updatedAt: string; /** - * Can user change the plan themselves + * Default value for column when not provided. Cannot be set when column is required. */ - selfService: boolean; + default?: any[]; + } + + /** + * ColumnRelationship + */ + export type ColumnRelationship = { /** - * Does plan enable premium support + * Column Key. */ - premiumSupport: boolean; + key: string; /** - * Does plan support budget cap + * Column type. */ - budgeting: boolean; + type: string; /** - * Does plan support mock numbers + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - supportsMockNumbers: boolean; + status: ColumnStatus; /** - * Does plan support organization roles + * Error message. Displays error generated on failure of creating or deleting an column. */ - supportsOrganizationRoles: boolean; + error: string; /** - * Does plan support credit + * Is column required? */ - supportsCredits: boolean; + required: boolean; /** - * Does plan support backup policies. + * Is column an array? */ - backupsEnabled: boolean; + array?: boolean; /** - * Whether usage addons are calculated per project. + * Column creation date in ISO 8601 format. */ - usagePerProject: boolean; + $createdAt: string; /** - * How many policies does plan support + * Column update date in ISO 8601 format. */ - backupPolicies: number; + $updatedAt: string; /** - * Maximum function and site deployment size in MB + * The ID of the related table. */ - deploymentSize: number; + relatedTable: string; /** - * Maximum function and site deployment size in MB + * The type of the relationship. */ - buildSize: number; + relationType: string; /** - * Does the plan support encrypted string attributes or not. + * Is the relationship two-way? */ - databasesAllowEncrypt: boolean; + twoWay: boolean; /** - * Plan specific limits + * The key of the two-way relationship. */ - limits?: BillingPlanLimits; + twoWayKey: string; /** - * Group of this billing plan for variants + * How deleting the parent document will propagate to child documents. */ - group: BillingPlanGroup; + onDelete: string; /** - * Details of the program this plan is a part of. + * Whether this is the parent or child side of the relationship */ - program?: Program; + side: string; } /** - * BillingPlanAddon + * ColumnString */ - export type BillingPlanAddon = { + export type ColumnString = { /** - * Addon seats + * Column Key. */ - seats: BillingPlanAddonDetails; + key: string; /** - * Addon projects + * Column type. */ - projects: BillingPlanAddonDetails; - } - - /** - * BillingPlanAddonDetails - */ - export type BillingPlanAddonDetails = { + type: string; /** - * Is the addon supported in the plan? + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - supported: boolean; + status: ColumnStatus; /** - * Addon plan included value + * Error message. Displays error generated on failure of creating or deleting an column. */ - planIncluded: number; + error: string; /** - * Addon limit + * Is column required? */ - limit: number; + required: boolean; /** - * Addon type + * Is column an array? */ - type: string; + array?: boolean; /** - * Price currency + * Column creation date in ISO 8601 format. */ - currency: string; + $createdAt: string; /** - * Price + * Column update date in ISO 8601 format. */ - price: number; + $updatedAt: string; /** - * Resource value + * Column size. */ - value: number; + size: number; /** - * Description on invoice + * Default value for column when not provided. Cannot be set when column is required. */ - invoiceDesc: string; + default?: string; + /** + * Defines whether this column is encrypted or not. + */ + encrypt?: boolean; } /** - * BillingPlanLimits + * ColumnText */ - export type BillingPlanLimits = { + export type ColumnText = { /** - * Credits limit per billing cycle + * Column Key. */ - credits?: number; + key: string; /** - * Daily credits limit (if applicable) + * Column type. */ - dailyCredits?: number; - } - - /** - * BillingLimits - */ - export type BillingLimits = { + type: string; /** - * Bandwidth limit + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - bandwidth: number; + status: ColumnStatus; /** - * Storage limit + * Error message. Displays error generated on failure of creating or deleting an column. */ - storage: number; + error: string; /** - * Users limit + * Is column required? */ - users: number; + required: boolean; /** - * Executions limit + * Is column an array? */ - executions: number; + array?: boolean; /** - * GBHours limit + * Column creation date in ISO 8601 format. */ - GBHours: number; + $createdAt: string; /** - * Image transformations limit + * Column update date in ISO 8601 format. */ - imageTransformations: number; + $updatedAt: string; /** - * Auth phone limit + * Default value for column when not provided. Cannot be set when column is required. */ - authPhone: number; + default?: string; /** - * Budget limit percentage + * Defines whether this column is encrypted or not. */ - budgetLimit: number; + encrypt?: boolean; } /** - * Block + * ColumnURL */ - export type Block = { + export type ColumnUrl = { /** - * Block creation date in ISO 8601 format. + * Column Key. */ - $createdAt: string; + key: string; /** - * Resource type that is blocked + * Column type. */ - resourceType: string; + type: string; /** - * Resource identifier that is blocked + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - resourceId: string; + status: ColumnStatus; /** - * Reason for the block + * Error message. Displays error generated on failure of creating or deleting an column. */ - reason: string; + error: string; /** - * Block expiration date in ISO 8601 format. + * Is column required? */ - expiredAt: string; + required: boolean; + /** + * Is column an array? + */ + array?: boolean; + /** + * Column creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Column update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * String format. + */ + format: string; + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + default?: string; } /** - * Campaign + * ColumnVarchar */ - export type Campaign = { - /** - * Campaign ID - */ - $id: string; + export type ColumnVarchar = { /** - * Campaign template + * Column Key. */ - template: string; + key: string; /** - * Campaign title + * Column type. */ - title: string; + type: string; /** - * Campaign description + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - description: string; + status: ColumnStatus; /** - * Billing plan campaign is associated with + * Error message. Displays error generated on failure of creating or deleting an column. */ - plan?: string; + error: string; /** - * Campaign CTA + * Is column required? */ - cta?: string; + required: boolean; /** - * Campaign info when claimed + * Is column an array? */ - claimed?: string; + array?: boolean; /** - * Campaign infor when unclaimed + * Column creation date in ISO 8601 format. */ - unclaimed?: string; + $createdAt: string; /** - * Campaign images + * Column update date in ISO 8601 format. */ - image?: object; + $updatedAt: string; /** - * Campaign reviews + * Column size. */ - reviews?: Review[]; + size: number; /** - * Campaign valid only for new orgs. + * Default value for column when not provided. Cannot be set when column is required. */ - onlyNewOrgs?: boolean; + default?: string; /** - * Is footer + * Defines whether this column is encrypted or not. */ - footer?: boolean; + encrypt?: boolean; } /** - * Program + * Index */ - export type Program = { + export type ColumnIndex = { /** - * Program ID + * Index ID. */ $id: string; /** - * Program title + * Index creation date in ISO 8601 format. */ - title: string; + $createdAt: string; /** - * Program description + * Index update date in ISO 8601 format. */ - description: string; + $updatedAt: string; /** - * Program tag for highlighting on console + * Index Key. */ - tag: string; + key: string; /** - * Program icon for highlighting on console + * Index type. */ - icon: string; + type: string; /** - * URL for more information on this program + * Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - url: string; + status: string; /** - * Whether this program is active + * Error message. Displays error generated on failure of creating or deleting an index. */ - active: boolean; + error: string; /** - * Whether this program is external + * Index columns. */ - external: boolean; + columns: string[]; /** - * Billing plan ID that this is program is associated with. + * Index columns length. */ - billingPlanId: string; + lengths: number[]; + /** + * Index orders. + */ + orders?: string[]; } /** - * Coupon + * Rows List */ - export type Coupon = { + export type RowList = { /** - * coupon ID + * Total number of rows that matched your query. */ - $id: string; + total: number; /** - * coupon ID + * List of rows. */ - code: string; + rows: Row[]; + } + + /** + * Row + */ + export type Row = { /** - * Provided credit amount + * Row ID. */ - credits: number; + $id: string; /** - * Coupon expiration time in ISO 8601 format. + * Row sequence ID. */ - expiration: string; + $sequence: string; /** - * Credit validity in days. + * Table ID. */ - validity: number; + $tableId: string; /** - * Campaign the coupon is associated with`. + * Database ID. */ - campaign: string; + $databaseId: string; /** - * Status of the coupon. Can be one of `disabled`, `active` or `expired`. + * Row creation date in ISO 8601 format. */ - status: string; + $createdAt: string; /** - * If the coupon is only valid for new organizations or not. + * Row update date in ISO 8601 format. */ - onlyNewOrgs: boolean; + $updatedAt: string; + /** + * Row permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + */ + $permissions: string[]; } + export type DefaultRow = Row & { + [key: string]: any; + [__default]: true; + }; + /** - * Credit + * UsageTable */ - export type Credit = { - /** - * Credit ID. - */ - $id: string; + export type UsageTable = { /** - * Credit creation time in ISO 8601 format. + * Time range of the usage stats. */ - $createdAt: string; + range: string; /** - * Credit update date in ISO 8601 format. + * Total aggregated number of of rows. */ - $updatedAt: string; + rowsTotal: number; /** - * Credit permissions. [Learn more about permissions](/docs/permissions). + * Aggregated number of rows per period. */ - $permissions: string[]; + rows: Metric[]; + } + + /** + * Teams List + */ + export type TeamList = { /** - * coupon ID + * Total number of teams that matched your query. */ - couponId: string; + total: number; /** - * ID of the User. + * List of teams. */ - userId: string; + teams: Team[]; + } + + /** + * Team + */ + export type Team = { /** - * ID of the Team. + * Team ID. */ - teamId: string; + $id: string; /** - * Provided credit amount + * Team creation date in ISO 8601 format. */ - credits: number; + $createdAt: string; /** - * Provided credit amount + * Team update date in ISO 8601 format. */ - total: number; + $updatedAt: string; /** - * Credit expiration time in ISO 8601 format. + * Team name. */ - expiration: string; + name: string; /** - * Status of the credit. Can be one of `disabled`, `active` or `expired`. + * Total number of team members. */ - status: string; - } - - /** - * CreditAvailable - */ - export type CreditAvailable = { + total: number; /** - * Total available credits for the organization. + * Team preferences as a key-value object */ - available: number; + prefs: Preferences; } /** - * CreditList + * Memberships List */ - export type CreditList = { - /** - * Credits - */ - credits: Credit[]; + export type MembershipList = { /** - * Total number of credits + * Total number of memberships that matched your query. */ total: number; /** - * Total available credit balance in USD + * List of memberships. */ - available: number; + memberships: Membership[]; } /** - * Downgrade Feedback + * Membership */ - export type DowngradeFeedback = { + export type Membership = { /** - * Feedback ID. + * Membership ID. */ $id: string; /** - * Feedback creation date in ISO 8601 format. + * Membership creation date in ISO 8601 format. */ $createdAt: string; /** - * Feedback update date in ISO 8601 format. + * Membership update date in ISO 8601 format. */ $updatedAt: string; /** - * Feedback reason + * User ID. */ - title: string; + userId: string; /** - * Feedback message + * User name. Hide this attribute by toggling membership privacy in the Console. */ - message: string; + userName: string; /** - * Plan ID downgrading from + * User email address. Hide this attribute by toggling membership privacy in the Console. */ - fromPlanId: string; + userEmail: string; /** - * Plan ID downgrading to + * Team ID. */ - toPlanId: string; + teamId: string; /** - * Organization ID + * Team name. + */ + teamName: string; + /** + * Date, the user has been invited to join the team in ISO 8601 format. + */ + invited: string; + /** + * Date, the user has accepted the invitation to join the team in ISO 8601 format. + */ + joined: string; + /** + * User confirmation status, true if the user has joined the team or false otherwise. + */ + confirm: boolean; + /** + * Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console. + */ + mfa: boolean; + /** + * User list of roles */ - teamId: string; + roles: string[]; + } + + /** + * Resource Tokens List + */ + export type ResourceTokenList = { /** - * User ID who submitted feedback + * Total number of tokens that matched your query. */ - userId: string; + total: number; /** - * Console version + * List of tokens. */ - version: string; + tokens: ResourceToken[]; } /** - * Invoice + * ResourceToken */ - export type Invoice = { + export type ResourceToken = { /** - * Invoice ID. + * Token ID. */ $id: string; /** - * Invoice creation time in ISO 8601 format. + * Token creation date in ISO 8601 format. */ $createdAt: string; /** - * Invoice update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Invoice permissions. [Learn more about permissions](/docs/permissions). + * Resource ID. */ - $permissions: string[]; + resourceId: string; /** - * Project ID + * Resource type. */ - teamId: string; + resourceType: string; /** - * Aggregation ID + * Token expiration date in ISO 8601 format. */ - aggregationId: string; + expire: string; /** - * Billing plan selected. Can be one of `tier-0`, `tier-1` or `tier-2`. + * JWT encoded string. */ - plan: string; + secret: string; /** - * Usage breakdown per resource + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. */ - usage: UsageResources[]; + accessedAt: string; + } + + /** + * Users List + */ + export type UserList = { /** - * Invoice Amount + * Total number of users that matched your query. */ - amount: number; + total: number; /** - * Tax percentage + * List of users. */ - tax: number; + users: User[]; + } + + /** + * UsageUsers + */ + export type UsageUsers = { /** - * Tax amount + * Time range of the usage stats. */ - taxAmount: number; + range: string; /** - * VAT percentage + * Total aggregated number of statistics of users. */ - vat: number; + usersTotal: number; /** - * VAT amount + * Total aggregated number of active sessions. */ - vatAmount: number; + sessionsTotal: number; /** - * Gross amount after vat, tax, and discounts applied. + * Aggregated number of users per period. */ - grossAmount: number; + users: Metric[]; /** - * Credits used. + * Aggregated number of active sessions per period. */ - creditsUsed: number; + sessions: Metric[]; + } + + /** + * DetectionFramework + */ + export type DetectionFramework = { /** - * Currency the invoice is in + * Environment variables found in .env files */ - currency: string; + variables?: DetectionVariable[]; /** - * Client secret for processing failed payments in front-end + * Framework */ - clientSecret: string; + framework: string; /** - * Invoice status + * Site Install Command */ - status: string; + installCommand: string; /** - * Last payment error associated with the invoice + * Site Build Command */ - lastError: string; + buildCommand: string; /** - * Invoice due date. + * Site Output Directory */ - dueAt: string; + outputDirectory: string; + } + + /** + * Framework Provider Repositories List + */ + export type ProviderRepositoryFrameworkList = { /** - * Beginning date of the invoice + * Total number of frameworkProviderRepositories that matched your query. */ - from: string; + total: number; /** - * End date of the invoice + * List of frameworkProviderRepositories. */ - to: string; + frameworkProviderRepositories: ProviderRepositoryFramework[]; } /** - * Organization + * ProviderRepository */ - export type Organization = { + export type ProviderRepository = { /** - * Team ID. + * VCS (Version Control System) repository ID. */ - $id: string; + id: string; /** - * Team creation date in ISO 8601 format. + * VCS (Version Control System) repository name. */ - $createdAt: string; + name: string; /** - * Team update date in ISO 8601 format. + * VCS (Version Control System) organization name */ - $updatedAt: string; + organization: string; /** - * Team name. + * VCS (Version Control System) provider name. */ - name: string; + provider: string; /** - * Total number of team members. + * Is VCS (Version Control System) repository private? */ - total: number; + private: boolean; /** - * Team preferences as a key-value object + * VCS (Version Control System) repository's default branch name. */ - prefs: Preferences; + defaultBranch: string; /** - * Project budget limit + * VCS (Version Control System) installation ID. */ - billingBudget: number; + providerInstallationId: string; /** - * Project budget limit + * Is VCS (Version Control System) repository authorized for the installation? */ - budgetAlerts: number[]; + authorized: boolean; /** - * Organization's billing plan ID. + * Last commit date in ISO 8601 format. */ - billingPlan: string; + pushedAt: string; /** - * Organization's billing plan ID. + * Environment variables found in .env files */ - billingPlanId: string; + variables: string[]; + } + + /** + * Branches List + */ + export type BranchList = { /** - * Organization's billing plan. + * Total number of branches that matched your query. */ - billingPlanDetails: BillingPlan; + total: number; /** - * Billing email set for the organization. + * List of branches. */ - billingEmail: string; + branches: Branch[]; + } + + /** + * VCS Content List + */ + export type VcsContentList = { /** - * Billing cycle start date. + * Total number of contents that matched your query. */ - billingStartDate: string; + total: number; /** - * Current invoice cycle start date. + * List of contents. */ - billingCurrentInvoiceDate: string; + contents: VcsContent[]; + } + + /** + * Installations List + */ + export type InstallationList = { /** - * Next invoice cycle start date. + * Total number of installations that matched your query. */ - billingNextInvoiceDate: string; + total: number; /** - * Start date of trial. + * List of installations. */ - billingTrialStartDate: string; + installations: Installation[]; + } + + /** + * Installation + */ + export type Installation = { /** - * Number of trial days. + * Function ID. */ - billingTrialDays: number; + $id: string; /** - * Current active aggregation id. + * Function creation date in ISO 8601 format. */ - billingAggregationId: string; + $createdAt: string; /** - * Current active aggregation id. + * Function update date in ISO 8601 format. */ - billingInvoiceId: string; + $updatedAt: string; /** - * Default payment method. + * VCS (Version Control System) provider name. */ - paymentMethodId: string; + provider: string; /** - * Default payment method. + * VCS (Version Control System) organization name. */ - billingAddressId: string; + organization: string; /** - * Backup payment method. + * VCS (Version Control System) installation ID. + */ + providerInstallationId: string; + } + + /** + * Webhooks List + */ + export type WebhookList = { + /** + * Total number of webhooks that matched your query. + */ + total: number; + /** + * List of webhooks. */ - backupPaymentMethodId: string; + webhooks: Webhook[]; + } + + /** + * Webhook + */ + export type Webhook = { /** - * Team status. + * Webhook ID. */ - status: string; + $id: string; /** - * Remarks on team status. + * Webhook creation date in ISO 8601 format. */ - remarks: string; + $createdAt: string; /** - * Organization agreements + * Webhook update date in ISO 8601 format. */ - agreementBAA: string; + $updatedAt: string; /** - * Program manager's name. + * Webhook name. */ - programManagerName: string; + name: string; /** - * Program manager's calendar link. + * Webhook URL endpoint. */ - programManagerCalendar: string; + url: string; /** - * Program's discord channel name. + * Webhook trigger events. */ - programDiscordChannelName: string; + events: string[]; /** - * Program's discord channel URL. + * Indicated if SSL / TLS Certificate verification is enabled. */ - programDiscordChannelUrl: string; + security: boolean; /** - * Billing limits reached + * HTTP basic authentication username. */ - billingLimits: BillingLimits; + httpUser: string; /** - * Billing plan selected for downgrade. + * HTTP basic authentication password. */ - billingPlanDowngrade: string; + httpPass: string; /** - * Tax Id + * Signature key which can be used to validated incoming */ - billingTaxId: string; + signatureKey: string; /** - * Marked for deletion + * Indicates if this webhook is enabled. */ - markedForDeletion: boolean; + enabled: boolean; /** - * Product with which the organization is associated (appwrite or imagine) + * Webhook error logs from the most recent failure. */ - platform: string; + logs: string; /** - * Selected projects + * Number of consecutive failed webhook attempts. */ - projects: string[]; + attempts: number; } /** - * PaymentAuthentication + * AlgoArgon2 */ - export type PaymentAuthentication = { + export type AlgoArgon2 = { /** - * Message for the end user to show on Console. + * Algo type. */ - message: string; + type: string; /** - * Stripe client secret to use for validation. + * Memory used to compute hash. */ - clientSecret: string; + memoryCost: number; /** - * Organization ID for which the payment authentication is needed. + * Amount of time consumed to compute hash */ - organizationId: string; + timeCost: number; /** - * Invoice ID against which the payment needs to be validated. + * Number of threads used to compute hash. */ - invoiceId: string; + threads: number; } /** - * paymentMethod + * AlgoScrypt */ - export type PaymentMethod = { - /** - * Payment Method ID. - */ - $id: string; - /** - * Payment method creation time in ISO 8601 format. - */ - $createdAt: string; - /** - * Payment method update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Payment method permissions. [Learn more about permissions](/docs/permissions). - */ - $permissions: string[]; - /** - * Payment method ID from the payment provider - */ - providerMethodId: string; - /** - * Client secret hash for payment setup - */ - clientSecret: string; - /** - * User ID from the payment provider. - */ - providerUserId: string; + export type AlgoScrypt = { /** - * ID of the Team. + * Algo type. */ - userId: string; + type: string; /** - * Expiry month of the payment method. + * CPU complexity of computed hash. */ - expiryMonth: number; + costCpu: number; /** - * Expiry year of the payment method. + * Memory complexity of computed hash. */ - expiryYear: number; + costMemory: number; /** - * Last 4 digit of the payment method + * Parallelization of computed hash. */ - last4: string; + costParallel: number; /** - * Payment method brand + * Length used to compute hash. */ - brand: string; + length: number; + } + + /** + * AlgoScryptModified + */ + export type AlgoScryptModified = { /** - * Name of the owner + * Algo type. */ - name: string; + type: string; /** - * Mandate ID of the payment method + * Salt used to compute hash. */ - mandateId: string; + salt: string; /** - * Country of the payment method + * Separator used to compute hash. */ - country: string; + saltSeparator: string; /** - * State of the payment method + * Key used to compute hash. */ - state: string; + signerKey: string; + } + + /** + * AlgoBcrypt + */ + export type AlgoBcrypt = { /** - * Last payment error associated with the payment method. + * Algo type. */ - lastError: string; + type: string; + } + + /** + * AlgoPHPass + */ + export type AlgoPhpass = { /** - * True when it's the default payment method. + * Algo type. */ - default: boolean; + type: string; + } + + /** + * AlgoSHA + */ + export type AlgoSha = { /** - * True when payment method has expired. + * Algo type. */ - expired: boolean; + type: string; + } + + /** + * AlgoMD5 + */ + export type AlgoMd5 = { /** - * True when payment method has failed to process multiple times. + * Algo type. */ - failed: boolean; + type: string; } /** - * backup + * Identity */ - export type BackupPolicy = { + export type Identity = { /** - * Backup policy ID. + * Identity ID. */ $id: string; /** - * Backup policy name. - */ - name: string; - /** - * Policy creation date in ISO 8601 format. + * Identity creation date in ISO 8601 format. */ $createdAt: string; /** - * Policy update date in ISO 8601 format. + * Identity update date in ISO 8601 format. */ $updatedAt: string; /** - * The services that are backed up by this policy. + * User ID. */ - services: string[]; + userId: string; /** - * The resources that are backed up by this policy. + * Identity Provider. */ - resources: string[]; + provider: string; /** - * The resource ID to backup. Set only if this policy should backup a single resource. + * ID of the User in the Identity Provider. */ - resourceId?: string; + providerUid: string; /** - * The resource type to backup. Set only if this policy should backup a single resource. + * Email of the User in the Identity Provider. */ - resourceType?: string; + providerEmail: string; /** - * How many days to keep the backup before it will be automatically deleted. + * Identity Provider Access Token. */ - retention: number; + providerAccessToken: string; /** - * Policy backup schedule in CRON format. + * The date of when the access token expires in ISO 8601 format. */ - schedule: string; + providerAccessTokenExpiry: string; /** - * Is this policy enabled. + * Identity Provider Refresh Token. */ - enabled: boolean; + providerRefreshToken: string; } /** - * Region + * Log */ - export type ConsoleRegion = { + export type Log = { + /** + * Event name. + */ + event: string; + /** + * User ID of the actor recorded for this log. During impersonation, this is the original impersonator, not the impersonated target user. + */ + userId: string; + /** + * User email of the actor recorded for this log. During impersonation, this is the original impersonator. + */ + userEmail: string; + /** + * User name of the actor recorded for this log. During impersonation, this is the original impersonator. + */ + userName: string; /** - * Region ID + * API mode when event triggered. */ - $id: string; + mode: string; /** - * Region name + * IP session in use when the session was created. */ - name: string; + ip: string; /** - * Does the organization have access to this region. + * Log creation date in ISO 8601 format. */ - available: boolean; + time: string; /** - * Does the backend support this region. + * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). */ - disabled: boolean; + osCode: string; /** - * Is this the region default. + * Operating system name. */ - default: boolean; + osName: string; /** - * Region flag code. + * Operating system version. */ - flag: string; - } - - /** - * Restoration - */ - export type BackupRestoration = { + osVersion: string; /** - * Restoration ID. + * Client type. */ - $id: string; + clientType: string; /** - * Restoration creation time in ISO 8601 format. + * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). */ - $createdAt: string; + clientCode: string; /** - * Restoration update date in ISO 8601 format. + * Client name. */ - $updatedAt: string; + clientName: string; /** - * Backup archive ID. + * Client version. */ - archiveId: string; + clientVersion: string; /** - * Backup policy ID. + * Client engine name. */ - policyId: string; + clientEngine: string; /** - * The status of the restoration. Possible values: pending, downloading, processing, completed, failed. + * Client engine name. */ - status: string; + clientEngineVersion: string; /** - * The backup start time. + * Device name. */ - startedAt: string; + deviceName: string; /** - * Migration ID. + * Device brand name. */ - migrationId: string; + deviceBrand: string; /** - * The services that are backed up by this policy. + * Device model name. */ - services: string[]; + deviceModel: string; /** - * The resources that are backed up by this policy. + * Country two-character ISO 3166-1 alpha code. */ - resources: string[]; + countryCode: string; /** - * Optional data in key-value object. + * Country name. */ - options: string; + countryName: string; } /** @@ -8978,363 +8452,467 @@ export namespace Models { } /** - * Roles + * usageBillingPlan */ - export type Roles = { + export type UsageBillingPlan = { /** - * Array of scopes accessible to current user. + * Bandwidth additional resources */ - scopes: string[]; + bandwidth: AdditionalResource; /** - * Array of roles assigned to current user. + * Executions additional resources */ - roles: string[]; - } - - /** - * UsageOrganization - */ - export type UsageOrganization = { + executions: AdditionalResource; /** - * Aggregated stats for number of requests. + * Member additional resources */ - bandwidth: Metric[]; + member: AdditionalResource; /** - * Aggregated stats for consumed bandwidth. + * Realtime additional resources */ - users: Metric[]; + realtime: AdditionalResource; /** - * Aggregated stats for function executions. + * Realtime messages additional resources */ - executions: Metric[]; + realtimeMessages: AdditionalResource; /** - * Aggregated stats for database reads. + * Realtime bandwidth additional resources */ - databasesReads: Metric[]; + realtimeBandwidth: AdditionalResource; /** - * Aggregated stats for database writes. + * Storage additional resources */ - databasesWrites: Metric[]; + storage: AdditionalResource; /** - * Aggregated stats for file transformations. + * User additional resources */ - imageTransformations: Metric[]; + users: AdditionalResource; /** - * Aggregated stats for total file transformations. + * GBHour additional resources */ - imageTransformationsTotal: number; + GBHours: AdditionalResource; /** - * Aggregated stats for file transformations. + * Image transformation additional resources */ - screenshotsGenerated: Metric[]; + imageTransformations: AdditionalResource; /** - * Aggregated stats for total file transformations. + * Credits additional resources */ - screenshotsGeneratedTotal: number; + credits: AdditionalResource; + } + + /** + * BillingPlanAddon + */ + export type BillingPlanAddon = { /** - * Aggregated stats for imagine credits. + * Addon seats */ - imagineCredits: Metric[]; + seats: BillingPlanAddonDetails; /** - * Aggregated stats for total imagine credits. + * Addon projects */ - imagineCreditsTotal: number; + projects: BillingPlanAddonDetails; + } + + /** + * BillingPlanLimits + */ + export type BillingPlanLimits = { /** - * Aggregated stats for total users. + * Credits limit per billing cycle */ - usersTotal: number; + credits?: number; /** - * Aggregated stats for total executions. + * Daily credits limit (if applicable) */ - executionsTotal: number; + dailyCredits?: number; + } + + /** + * BillingLimits + */ + export type BillingLimits = { /** - * Aggregated stats for function executions in mb seconds. + * Bandwidth limit */ - executionsMBSecondsTotal: number; + bandwidth: number; /** - * Aggregated stats for function builds in mb seconds. + * Storage limit */ - buildsMBSecondsTotal: number; + storage: number; /** - * Aggregated stats for total file storage. + * Users limit */ - filesStorageTotal: number; + users: number; /** - * Aggregated stats for total builds storage. + * Executions limit */ - buildsStorageTotal: number; + executions: number; /** - * Aggregated stats for total deployments storage. + * GBHours limit */ - deploymentsStorageTotal: number; + GBHours: number; /** - * Aggregated stats for total databases storage. + * Image transformations limit */ - databasesStorageTotal: number; + imageTransformations: number; /** - * Aggregated stats for total databases reads. + * Auth phone limit */ - databasesReadsTotal: number; + authPhone: number; /** - * Aggregated stats for total databases writes. + * Budget limit percentage */ - databasesWritesTotal: number; + budgetLimit: number; + } + + /** + * Region + */ + export type ConsoleRegion = { /** - * Aggregated stats for total backups storage. + * Region ID */ - backupsStorageTotal: number; + $id: string; /** - * Aggregated stats for total storage. + * Region name */ - storageTotal: number; + name: string; /** - * Aggregated stats for total auth phone. + * Does the organization have access to this region. */ - authPhoneTotal: number; + available: boolean; /** - * Aggregated stats for total auth phone estimation. + * Does the backend support this region. */ - authPhoneEstimate: number; + disabled: boolean; + /** + * Is this the region default. + */ + default: boolean; + /** + * Region flag code. + */ + flag: string; + } + + /** + * Metric + */ + export type Metric = { + /** + * The value of this metric at the timestamp. + */ + value: number; + /** + * The date at which this metric was aggregated in ISO 8601 format. + */ + date: string; + } + + /** + * DomainSuggestion + */ + export type DomainSuggestion = { + /** + * Domain suggestion. + */ + domain: string; + /** + * Is the domain premium? + */ + premium: boolean; + /** + * Domain price. + */ + price?: number; /** - * Aggregated stats for each projects. + * Is the domain available? */ - projects: UsageOrganizationProject[]; + available: boolean; } /** - * UsageOrganizationProject + * Runtime */ - export type UsageOrganizationProject = { - /** - * projectId - */ - projectId: string; - /** - * Aggregated stats for number of requests. - */ - bandwidth: Metric[]; + export type Runtime = { /** - * Aggregated stats for consumed bandwidth. + * Runtime ID. */ - users: Metric[]; + $id: string; /** - * Aggregated stats for function executions. + * Parent runtime key. */ - executions: number; + key: string; /** - * Aggregated stats for database reads. + * Runtime Name. */ - databasesReads: Metric[]; + name: string; /** - * Aggregated stats for database writes. + * Runtime version. */ - databasesWrites: Metric[]; + version: string; /** - * Aggregated stats for function executions in mb seconds. + * Base Docker image used to build the runtime. */ - executionsMBSeconds: number; + base: string; /** - * Aggregated stats for function builds in mb seconds. + * Image name of Docker Hub. */ - buildsMBSeconds: number; + image: string; /** - * Aggregated stats for number of documents. + * Name of the logo image. */ - storage: number; + logo: string; /** - * Aggregated stats for phone authentication. + * List of supported architectures. */ - authPhoneTotal: number; + supports: string[]; + } + + /** + * Specification + */ + export type Specification = { /** - * Aggregated stats for phone authentication estimated cost. + * Memory size in MB. */ - authPhoneEstimate: number; + memory: number; /** - * Aggregated stats for total databases reads. + * Number of CPUs. */ - databasesReadsTotal: number; + cpus: number; /** - * Aggregated stats for total databases writes. + * Is size enabled. */ - databasesWritesTotal: number; + enabled: boolean; /** - * Aggregated stats for file transformations. + * Size slug. */ - imageTransformations: Metric[]; + slug: string; + } + + /** + * Template Runtime + */ + export type TemplateRuntime = { /** - * Aggregated stats for total file transformations. + * Runtime Name. */ - imageTransformationsTotal: number; + name: string; /** - * Aggregated stats for file transformations. + * The build command used to build the deployment. */ - screenshotsGenerated: Metric[]; + commands: string; /** - * Aggregated stats for total file transformations. + * The entrypoint file used to execute the deployment. */ - screenshotsGeneratedTotal: number; + entrypoint: string; /** - * Aggregated stats for imagine credits. + * Path to function in VCS (Version Control System) repository */ - imagineCredits: number; + providerRootDirectory: string; } /** - * Domain + * Template Variable */ - export type Domain = { + export type TemplateVariable = { /** - * Domain ID. + * Variable Name. */ - $id: string; + name: string; /** - * Domain creation time in ISO 8601 format. + * Variable Description. */ - $createdAt: string; + description: string; /** - * Domain update date in ISO 8601 format. + * Variable Value. */ - $updatedAt: string; + value: string; /** - * Domain name. + * Variable secret flag. Secret variables can only be updated or deleted, but never read. */ - domain: string; + secret: boolean; /** - * Domain registrar (e.g. "appwrite" or "third_party"). + * Variable Placeholder. */ - registrar: string; + placeholder: string; /** - * Nameservers setting. "Appwrite" or empty string. + * Is the variable required? */ - nameservers: string; + required: boolean; /** - * Domain expiry date in ISO 8601 format. + * Variable Type. */ - expire: string; + type: string; + } + + /** + * Headers + */ + export type Headers = { /** - * Domain renewal date in ISO 8601 format. + * Header name. */ - renewal: string; + name: string; /** - * If set to true, the domain will automatically renew. + * Header value. */ - autoRenewal: boolean; + value: string; + } + + /** + * LocaleCode + */ + export type LocaleCode = { /** - * Renewal price (in cents). + * Locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) */ - renewalPrice: number; + code: string; /** - * Transfer status for domains being transferred in. + * Locale name */ - transferStatus: DomainTransferStatusEnum; + name: string; + } + + /** + * Continent + */ + export type Continent = { /** - * Team ID. + * Continent name. */ - teamId: string; + name: string; /** - * Dns records + * Continent two letter code. */ - dnsRecords: DnsRecord[]; + code: string; } /** - * DomainPurchase + * Country */ - export type DomainPurchase = { + export type Country = { /** - * Purchase/invoice ID. + * Country name. */ - $id: string; + name: string; /** - * Purchase creation time in ISO 8601 format. + * Country two-character ISO 3166-1 alpha code. */ - $createdAt: string; + code: string; + } + + /** + * Phone + */ + export type Phone = { /** - * Purchase update date in ISO 8601 format. + * Phone code. */ - $updatedAt: string; + code: string; /** - * Domain document ID. + * Country two-character ISO 3166-1 alpha code. */ - domainId: string; + countryCode: string; /** - * Domain name. + * Country name. */ - domain: string; + countryName: string; + } + + /** + * Currency + */ + export type Currency = { /** - * Team ID that owns the domain. + * Currency symbol. */ - organizationId: string; + symbol: string; /** - * Domain purchase status. + * Currency name. */ - status: DomainPurchaseStatus; + name: string; /** - * Stripe client secret for 3DS; empty when not applicable. + * Currency native symbol. */ - clientSecret: string; + symbolNative: string; /** - * Purchase amount. + * Number of decimal digits. */ - amount: number; + decimalDigits: number; /** - * Currency code. + * Currency digit rounding. */ - currency: string; - } - - /** - * DNSRecord - */ - export type DnsRecord = { + rounding: number; /** - * DNS Record ID. + * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format. */ - $id: string; + code: string; /** - * DNS Record creation time in ISO 8601 format. + * Currency plural name */ - $createdAt: string; + namePlural: string; + } + + /** + * Language + */ + export type Language = { /** - * DNS Record update date in ISO 8601 format. + * Language name. */ - $updatedAt: string; + name: string; /** - * DNS record type (e.g. A, CNAME, MX). + * Language two-character ISO 639-1 codes. */ - type: string; + code: string; /** - * Record name or subdomain. + * Language native name. */ - name: string; + nativeName: string; + } + + /** + * EstimationItem + */ + export type EstimationItem = { /** - * Value of the record (IP address, domain, etc.). + * Label */ - value: string; + label: string; /** - * Time to live (in seconds). + * Gross payable amount */ - ttl: number; + value: number; + } + + /** + * AggregationBreakdown + */ + export type AggregationBreakdown = { /** - * Record priority (commonly used for MX). + * Aggregation ID. */ - priority: number; + $id: string; /** - * Whether this record is locked (read-only). + * Project name */ - lock: boolean; + name: string; /** - * Record weight (used for SRV records). + * Project region */ - weight: number; + region: string; /** - * Target port (used for SRV records). + * Aggregated amount */ - port: number; + amount: number; /** - * Comment for the DNS record. + * */ - comment: string; + resources: UsageResources[]; } /** @@ -9368,432 +8946,422 @@ export namespace Models { } /** - * usageBillingPlan + * UsageOrganizationProject */ - export type UsageBillingPlan = { - /** - * Bandwidth additional resources - */ - bandwidth: AdditionalResource; + export type UsageOrganizationProject = { /** - * Executions additional resources + * projectId */ - executions: AdditionalResource; + projectId: string; /** - * Member additional resources + * Aggregated stats for number of requests. */ - member: AdditionalResource; + bandwidth: Metric[]; /** - * Realtime additional resources + * Aggregated stats for consumed bandwidth. */ - realtime: AdditionalResource; + users: Metric[]; /** - * Realtime messages additional resources + * Aggregated stats for function executions. */ - realtimeMessages: AdditionalResource; + executions: number; /** - * Realtime bandwidth additional resources + * Aggregated stats for database reads. */ - realtimeBandwidth: AdditionalResource; + databasesReads: Metric[]; /** - * Storage additional resources + * Aggregated stats for database writes. */ - storage: AdditionalResource; + databasesWrites: Metric[]; /** - * User additional resources + * Aggregated stats for function executions in mb seconds. */ - users: AdditionalResource; + executionsMBSeconds: number; /** - * GBHour additional resources + * Aggregated stats for function builds in mb seconds. */ - GBHours: AdditionalResource; + buildsMBSeconds: number; /** - * Image transformation additional resources + * Aggregated stats for number of documents. */ - imageTransformations: AdditionalResource; + storage: number; /** - * Credits additional resources + * Aggregated stats for phone authentication. */ - credits: AdditionalResource; - } - - /** - * Estimation - */ - export type Estimation = { + authPhoneTotal: number; /** - * Total amount + * Aggregated stats for phone authentication estimated cost. */ - amount: number; + authPhoneEstimate: number; /** - * Gross payable amount + * Aggregated stats for total databases reads. */ - grossAmount: number; + databasesReadsTotal: number; /** - * Discount amount + * Aggregated stats for total databases writes. */ - discount: number; + databasesWritesTotal: number; /** - * Credits amount + * Aggregated stats for file transformations. */ - credits: number; + imageTransformations: Metric[]; /** - * Estimation items + * Aggregated stats for total file transformations. */ - items: EstimationItem[]; + imageTransformationsTotal: number; /** - * Estimation discount items + * Aggregated stats for file transformations. */ - discounts: EstimationItem[]; + screenshotsGenerated: Metric[]; /** - * Trial days + * Aggregated stats for total file transformations. */ - trialDays: number; + screenshotsGeneratedTotal: number; /** - * Trial end date + * Aggregated stats for imagine credits. */ - trialEndDate?: string; + imagineCredits: number; } /** - * EstimationUpdatePlan + * Metric Breakdown */ - export type EstimationUpdatePlan = { + export type MetricBreakdown = { /** - * Total amount + * Resource ID. */ - amount: number; + resourceId?: string; /** - * Gross payable amount + * Resource name. */ - grossAmount: number; + name: string; /** - * Discount amount + * The value of this metric at the timestamp. */ - discount: number; + value: number; /** - * Credits amount + * The estimated value of this metric at the end of the period. */ - credits: number; + estimate?: number; + } + + /** + * Mock Number + */ + export type MockNumber = { /** - * Estimation items + * Mock phone number for testing phone authentication. Useful for testing phone authentication without sending an SMS. */ - items: EstimationItem[]; + phone: string; /** - * Estimation discount items + * Mock OTP for the number. */ - discounts: EstimationItem[]; + otp: string; + } + + /** + * AuthProvider + */ + export type AuthProvider = { /** - * Trial days + * Auth Provider. */ - trialDays: number; + key: string; /** - * Trial end date + * Auth Provider name. */ - trialEndDate?: string; + name: string; /** - * Organization's existing credits + * OAuth 2.0 application ID. */ - organizationCredits: number; + appId: string; + /** + * OAuth 2.0 application secret. Might be JSON string if provider requires extra configuration. + */ + secret: string; + /** + * Auth Provider is active and can be used to create session. + */ + enabled: boolean; } /** - * EstimationDeleteOrganization + * Block */ - export type EstimationDeleteOrganization = { + export type Block = { /** - * List of unpaid invoices + * Block creation date in ISO 8601 format. */ - unpaidInvoices: Invoice[]; + $createdAt: string; + /** + * Resource type that is blocked + */ + resourceType: string; + /** + * Resource identifier that is blocked + */ + resourceId: string; + /** + * Reason for the block + */ + reason: string; + /** + * Block expiration date in ISO 8601 format. + */ + expiredAt: string; } /** - * EstimationItem + * Framework */ - export type EstimationItem = { + export type Framework = { /** - * Label + * Framework key. */ - label: string; + key: string; /** - * Gross payable amount + * Framework Name. */ - value: number; + name: string; + /** + * Default runtime version. + */ + buildRuntime: string; + /** + * List of supported runtime versions. + */ + runtimes: string[]; + /** + * List of supported adapters. + */ + adapters: FrameworkAdapter[]; } /** - * DomainPrice + * Template Framework */ - export type DomainPrice = { - /** - * Domain name. - */ - domain: string; + export type TemplateFramework = { /** - * Top-level domain for the requested domain. + * Parent framework key. */ - tld: string; + key: string; /** - * Whether the domain is currently available for registration. + * Framework Name. */ - available: boolean; + name: string; /** - * Domain registration price. + * The install command used to install the dependencies. */ - price: number; + installCommand: string; /** - * Price period in years. + * The build command used to build the deployment. */ - periodYears: number; + buildCommand: string; /** - * Whether the domain is a premium domain. + * The output directory to store the build output. */ - premium: boolean; - } - - /** - * DomainSuggestion - */ - export type DomainSuggestion = { + outputDirectory: string; /** - * Domain suggestion. + * Path to site in VCS (Version Control System) repository */ - domain: string; + providerRootDirectory: string; /** - * Is the domain premium? + * Runtime used during build step of template. */ - premium: boolean; + buildRuntime: string; /** - * Domain price. + * Site framework runtime */ - price?: number; + adapter: string; /** - * Is the domain available? + * Fallback file for SPA. Only relevant for static serve runtime. */ - available: boolean; + fallbackFile: string; } /** - * domainTransferOut + * DetectionVariable */ - export type DomainTransferOut = { + export type DetectionVariable = { /** - * Domain transfer authorization code. + * Name of environment variable */ - authCode: string; + name: string; + /** + * Value of environment variable + */ + value: string; } /** - * domainTransferStatus + * ProviderRepositoryFramework */ - export type DomainTransferStatus = { + export type ProviderRepositoryFramework = { /** - * Transfer status. + * VCS (Version Control System) repository ID. */ - status: DomainTransferStatusEnum; + id: string; /** - * Additional transfer status information. + * VCS (Version Control System) repository name. */ - reason: string; + name: string; /** - * Transfer status timestamp in ISO 8601 format. + * VCS (Version Control System) organization name */ - timestamp: string; - } - - /** - * Activity event list - */ - export type ActivityEventList = { + organization: string; /** - * Total number of events that matched your query. + * VCS (Version Control System) provider name. */ - total: number; + provider: string; /** - * List of events. + * Is VCS (Version Control System) repository private? */ - events: ActivityEvent[]; - } - - /** - * Aggregation team list - */ - export type AggregationTeamList = { + private: boolean; /** - * Total number of aggregations that matched your query. + * VCS (Version Control System) repository's default branch name. */ - total: number; + defaultBranch: string; /** - * List of aggregations. + * VCS (Version Control System) installation ID. */ - aggregations: AggregationTeam[]; - } - - /** - * Backup archive list - */ - export type BackupArchiveList = { + providerInstallationId: string; /** - * Total number of archives that matched your query. + * Is VCS (Version Control System) repository authorized for the installation? */ - total: number; + authorized: boolean; /** - * List of archives. + * Last commit date in ISO 8601 format. */ - archives: BackupArchive[]; - } - - /** - * Backup policy list - */ - export type BackupPolicyList = { + pushedAt: string; /** - * Total number of policies that matched your query. + * Environment variables found in .env files */ - total: number; + variables: string[]; /** - * List of policies. + * Auto-detected framework. Empty if type is not "framework". */ - policies: BackupPolicy[]; + framework: string; } /** - * Backup restoration list + * Branch */ - export type BackupRestorationList = { - /** - * Total number of restorations that matched your query. - */ - total: number; + export type Branch = { /** - * List of restorations. + * Branch Name. */ - restorations: BackupRestoration[]; + name: string; } /** - * Billing invoices list + * VcsContents */ - export type InvoiceList = { + export type VcsContent = { /** - * Total number of invoices that matched your query. + * Content size in bytes. Only files have size, and for directories, 0 is returned. */ - total: number; + size?: number; /** - * List of invoices. + * If a content is a directory. Directories can be used to check nested contents. */ - invoices: Invoice[]; + isDirectory?: boolean; + /** + * Name of directory or file. + */ + name: string; } /** - * Billing address list + * AdditionalResource */ - export type BillingAddressList = { + export type AdditionalResource = { /** - * Total number of billingAddresses that matched your query. + * Resource name */ - total: number; + name: string; /** - * List of billingAddresses. + * Resource unit */ - billingAddresses: BillingAddress[]; - } - - /** - * Billing plan list - */ - export type BillingPlanList = { + unit: string; /** - * Total number of plans that matched your query. + * Price currency */ - total: number; + currency: string; /** - * List of plans. + * Price */ - plans: BillingPlan[]; - } - - /** - * Organizations list - */ - export type OrganizationList = { + price: number; /** - * Total number of teams that matched your query. + * Resource value */ - total: number; + value: number; /** - * List of teams. + * Description on invoice */ - teams: Organization[]; + invoiceDesc: string; } /** - * Payment methods list + * BillingPlanAddonDetails */ - export type PaymentMethodList = { + export type BillingPlanAddonDetails = { /** - * Total number of paymentMethods that matched your query. + * Is the addon supported in the plan? */ - total: number; + supported: boolean; /** - * List of paymentMethods. + * Addon plan included value */ - paymentMethods: PaymentMethod[]; - } - - /** - * Regions list - */ - export type ConsoleRegionList = { + planIncluded: number; /** - * Total number of regions that matched your query. + * Addon limit */ - total: number; + limit: number; /** - * List of regions. + * Addon type */ - regions: ConsoleRegion[]; - } - - /** - * Domains list - */ - export type DomainsList = { + type: string; /** - * Total number of domains that matched your query. + * Price currency */ - total: number; + currency: string; /** - * List of domains. + * Price */ - domains: Domain[]; - } - - /** - * DNS records list - */ - export type DnsRecordsList = { + price: number; /** - * Total number of dnsRecords that matched your query. + * Resource value */ - total: number; + value: number; /** - * List of dnsRecords. + * Description on invoice */ - dnsRecords: DnsRecord[]; + invoiceDesc: string; } /** - * Domain suggestions list + * Framework Adapter */ - export type DomainSuggestionsList = { + export type FrameworkAdapter = { /** - * Total number of suggestions that matched your query. + * Adapter key. */ - total: number; + key: string; /** - * List of suggestions. + * Default command to download dependencies. */ - suggestions: DomainSuggestion[]; + installCommand: string; + /** + * Default command to build site into output directory. + */ + buildCommand: string; + /** + * Default output directory of build. + */ + outputDirectory: string; + /** + * Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. + */ + fallbackFile: string; } } From de2fdf80ad0533c542e375a5e78ecc7f48f7cabb Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Mar 2026 07:02:12 +0000 Subject: [PATCH 5/9] chore: update Console SDK to 7.0.0 --- src/index.ts | 12 +- src/models.ts | 9920 ++++++++++++++++++++++++------------------------- 2 files changed, 4966 insertions(+), 4966 deletions(-) diff --git a/src/index.ts b/src/index.ts index da3882ab..f058b3a0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -101,18 +101,18 @@ 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 { BillingPlanGroup } from './enums/billing-plan-group'; export { DatabaseType } from './enums/database-type'; export { AttributeStatus } from './enums/attribute-status'; +export { ColumnStatus } from './enums/column-status'; export { IndexStatus } from './enums/index-status'; -export { DomainTransferStatusEnum } from './enums/domain-transfer-status-enum'; -export { DomainPurchaseStatus } from './enums/domain-purchase-status'; export { DeploymentStatus } from './enums/deployment-status'; export { ExecutionTrigger } from './enums/execution-trigger'; export { ExecutionStatus } from './enums/execution-status'; -export { HealthCheckStatus } from './enums/health-check-status'; export { HealthAntivirusStatus } from './enums/health-antivirus-status'; -export { MessageStatus } from './enums/message-status'; +export { HealthCheckStatus } from './enums/health-check-status'; export { ProxyRuleDeploymentResourceType } from './enums/proxy-rule-deployment-resource-type'; export { ProxyRuleStatus } from './enums/proxy-rule-status'; -export { ColumnStatus } from './enums/column-status'; +export { MessageStatus } from './enums/message-status'; +export { BillingPlanGroup } from './enums/billing-plan-group'; +export { DomainTransferStatusEnum } from './enums/domain-transfer-status-enum'; +export { DomainPurchaseStatus } from './enums/domain-purchase-status'; diff --git a/src/models.ts b/src/models.ts index fb89b504..94df077b 100644 --- a/src/models.ts +++ b/src/models.ts @@ -1,19 +1,19 @@ -import { BillingPlanGroup } from "./enums/billing-plan-group" import { DatabaseType } from "./enums/database-type" import { AttributeStatus } from "./enums/attribute-status" +import { ColumnStatus } from "./enums/column-status" import { IndexStatus } from "./enums/index-status" -import { DomainTransferStatusEnum } from "./enums/domain-transfer-status-enum" -import { DomainPurchaseStatus } from "./enums/domain-purchase-status" import { DeploymentStatus } from "./enums/deployment-status" import { ExecutionTrigger } from "./enums/execution-trigger" import { ExecutionStatus } from "./enums/execution-status" -import { HealthCheckStatus } from "./enums/health-check-status" -import { HealthAntivirusStatus } from "./enums/health-antivirus-status" -import { MessageStatus } from "./enums/message-status" import { PlatformType } from "./enums/platform-type" +import { HealthAntivirusStatus } from "./enums/health-antivirus-status" +import { HealthCheckStatus } from "./enums/health-check-status" import { ProxyRuleDeploymentResourceType } from "./enums/proxy-rule-deployment-resource-type" import { ProxyRuleStatus } from "./enums/proxy-rule-status" -import { ColumnStatus } from "./enums/column-status" +import { MessageStatus } from "./enums/message-status" +import { BillingPlanGroup } from "./enums/billing-plan-group" +import { DomainTransferStatusEnum } from "./enums/domain-transfer-status-enum" +import { DomainPurchaseStatus } from "./enums/domain-purchase-status" /** * Appwrite Models @@ -23,183 +23,129 @@ export namespace Models { declare const __default: unique symbol; /** - * User + * Rows List */ - export type User = { - /** - * User ID. - */ - $id: string; - /** - * User creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * User update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * User name. - */ - name: string; - /** - * Hashed user password. - */ - password?: string; - /** - * Password hashing algorithm. - */ - hash?: string; - /** - * Password hashing algorithm configuration. - */ - hashOptions?: object; - /** - * User registration date in ISO 8601 format. - */ - registration: string; - /** - * User status. Pass `true` for enabled and `false` for disabled. - */ - status: boolean; - /** - * Labels for the user. - */ - labels: string[]; - /** - * Password update time in ISO 8601 format. - */ - passwordUpdate: string; - /** - * User email address. - */ - email: string; - /** - * User phone number in E.164 format. - */ - phone: string; - /** - * Email verification status. - */ - emailVerification: boolean; - /** - * Phone verification status. - */ - phoneVerification: boolean; - /** - * Multi factor authentication status. - */ - mfa: boolean; - /** - * User preferences as a key-value object - */ - prefs: Preferences; - /** - * A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider. - */ - targets: Target[]; - /** - * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. - */ - accessedAt: string; + export type RowList = { /** - * Whether the user can impersonate other users. + * Total number of rows that matched your query. */ - impersonator?: boolean; + total: number; /** - * ID of the original actor performing the impersonation. Present only when the current request is impersonating another user. Internal audit logs attribute the action to this user, while the impersonated target is recorded only in internal audit payload data. + * List of rows. */ - impersonatorUserId?: string; + rows: Row[]; } /** - * Billing address list + * Documents List */ - export type BillingAddressList = { + export type DocumentList = { /** - * Total number of billingAddresses that matched your query. + * Total number of documents that matched your query. */ total: number; /** - * List of billingAddresses. + * List of documents. */ - billingAddresses: BillingAddress[]; + documents: Document[]; } /** - * BillingAddress + * Tables List */ - export type BillingAddress = { - /** - * Region ID - */ - $id: string; - /** - * User ID - */ - userId: string; + export type TableList = { /** - * Street address + * Total number of tables that matched your query. */ - streetAddress: string; + total: number; /** - * Address line 2 + * List of tables. */ - addressLine2: string; + tables: Table[]; + } + + /** + * Collections List + */ + export type CollectionList = { /** - * Address country + * Total number of collections that matched your query. */ - country: string; + total: number; /** - * city + * List of collections. */ - city: string; + collections: Collection[]; + } + + /** + * Databases List + */ + export type DatabaseList = { /** - * state + * Total number of databases that matched your query. */ - state: string; + total: number; /** - * postal code + * List of databases. */ - postalCode: string; + databases: Database[]; } /** - * Coupon + * Indexes List */ - export type Coupon = { + export type IndexList = { /** - * coupon ID + * Total number of indexes that matched your query. */ - $id: string; + total: number; /** - * coupon ID + * List of indexes. */ - code: string; + indexes: Index[]; + } + + /** + * Column Indexes List + */ + export type ColumnIndexList = { /** - * Provided credit amount + * Total number of indexes that matched your query. */ - credits: number; + total: number; /** - * Coupon expiration time in ISO 8601 format. + * List of indexes. */ - expiration: string; + indexes: ColumnIndex[]; + } + + /** + * Users List + */ + export type UserList = { /** - * Credit validity in days. + * Total number of users that matched your query. */ - validity: number; + total: number; /** - * Campaign the coupon is associated with`. + * List of users. */ - campaign: string; + users: User[]; + } + + /** + * Sessions List + */ + export type SessionList = { /** - * Status of the coupon. Can be one of `disabled`, `active` or `expired`. + * Total number of sessions that matched your query. */ - status: string; + total: number; /** - * If the coupon is only valid for new organizations or not. + * List of sessions. */ - onlyNewOrgs: boolean; + sessions: Session[]; } /** @@ -217,1340 +163,1539 @@ export namespace Models { } /** - * Billing invoices list + * Logs List */ - export type InvoiceList = { + export type LogList = { /** - * Total number of invoices that matched your query. + * Total number of logs that matched your query. */ total: number; /** - * List of invoices. + * List of logs. */ - invoices: Invoice[]; + logs: Log[]; } /** - * JWT + * Files List */ - export type Jwt = { + export type FileList = { /** - * JWT encoded string. + * Total number of files that matched your query. */ - jwt: string; + total: number; + /** + * List of files. + */ + files: File[]; } /** - * API Keys List + * Buckets List */ - export type KeyList = { + export type BucketList = { /** - * Total number of keys that matched your query. + * Total number of buckets that matched your query. */ total: number; /** - * List of keys. + * List of buckets. */ - keys: Key[]; + buckets: Bucket[]; } /** - * Key + * Resource Tokens List */ - export type Key = { + export type ResourceTokenList = { /** - * Key ID. + * Total number of tokens that matched your query. */ - $id: string; + total: number; /** - * Key creation date in ISO 8601 format. + * List of tokens. */ - $createdAt: string; - /** - * Key update date in ISO 8601 format. - */ - $updatedAt: string; + tokens: ResourceToken[]; + } + + /** + * Teams List + */ + export type TeamList = { /** - * Key name. + * Total number of teams that matched your query. */ - name: string; + total: number; /** - * Key expiration date in ISO 8601 format. + * List of teams. */ - expire: string; + teams: Team[]; + } + + /** + * Memberships List + */ + export type MembershipList = { /** - * Allowed permission scopes. + * Total number of memberships that matched your query. */ - scopes: string[]; + total: number; /** - * Secret key. + * List of memberships. */ - secret: string; + memberships: Membership[]; + } + + /** + * Sites List + */ + export type SiteList = { /** - * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + * Total number of sites that matched your query. */ - accessedAt: string; + total: number; /** - * List of SDK user agents that used this key. + * List of sites. */ - sdks: string[]; + sites: Site[]; } /** - * Logs List + * Site Templates List */ - export type LogList = { + export type TemplateSiteList = { /** - * Total number of logs that matched your query. + * Total number of templates that matched your query. */ total: number; /** - * List of logs. + * List of templates. */ - logs: Log[]; + templates: TemplateSite[]; } /** - * MFAType + * Functions List */ - export type MfaType = { + export type FunctionList = { /** - * Secret token used for TOTP factor. + * Total number of functions that matched your query. */ - secret: string; + total: number; /** - * URI for authenticator apps. + * List of functions. */ - uri: string; + functions: Function[]; } /** - * MFA Challenge + * Function Templates List */ - export type MfaChallenge = { + export type TemplateFunctionList = { /** - * Token ID. + * Total number of templates that matched your query. */ - $id: string; + total: number; /** - * Token creation date in ISO 8601 format. + * List of templates. */ - $createdAt: string; + templates: TemplateFunction[]; + } + + /** + * Installations List + */ + export type InstallationList = { /** - * User ID. + * Total number of installations that matched your query. */ - userId: string; + total: number; /** - * Token expiration date in ISO 8601 format. + * List of installations. */ - expire: string; + installations: Installation[]; } /** - * Session + * Framework Provider Repositories List */ - export type Session = { + export type ProviderRepositoryFrameworkList = { /** - * Session ID. + * Total number of frameworkProviderRepositories that matched your query. */ - $id: string; + total: number; /** - * Session creation date in ISO 8601 format. + * List of frameworkProviderRepositories. */ - $createdAt: string; + frameworkProviderRepositories: ProviderRepositoryFramework[]; + } + + /** + * Branches List + */ + export type BranchList = { /** - * Session update date in ISO 8601 format. + * Total number of branches that matched your query. */ - $updatedAt: string; + total: number; /** - * User ID. + * List of branches. */ - userId: string; + branches: Branch[]; + } + + /** + * Frameworks List + */ + export type FrameworkList = { /** - * Session expiration date in ISO 8601 format. + * Total number of frameworks that matched your query. */ - expire: string; + total: number; /** - * Session Provider. + * List of frameworks. */ - provider: string; + frameworks: Framework[]; + } + + /** + * Runtimes List + */ + export type RuntimeList = { /** - * Session Provider User ID. + * Total number of runtimes that matched your query. */ - providerUid: string; + total: number; /** - * Session Provider Access Token. + * List of runtimes. */ - providerAccessToken: string; + runtimes: Runtime[]; + } + + /** + * Deployments List + */ + export type DeploymentList = { /** - * The date of when the access token expires in ISO 8601 format. + * Total number of deployments that matched your query. */ - providerAccessTokenExpiry: string; + total: number; /** - * Session Provider Refresh Token. + * List of deployments. */ - providerRefreshToken: string; + deployments: Deployment[]; + } + + /** + * Executions List + */ + export type ExecutionList = { /** - * IP in use when the session was created. + * Total number of executions that matched your query. */ - ip: string; + total: number; /** - * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). + * List of executions. */ - osCode: string; + executions: Execution[]; + } + + /** + * Projects List + */ + export type ProjectList = { /** - * Operating system name. + * Total number of projects that matched your query. */ - osName: string; + total: number; /** - * Operating system version. + * List of projects. */ - osVersion: string; + projects: Project[]; + } + + /** + * Webhooks List + */ + export type WebhookList = { /** - * Client type. + * Total number of webhooks that matched your query. */ - clientType: string; + total: number; /** - * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). + * List of webhooks. */ - clientCode: string; + webhooks: Webhook[]; + } + + /** + * API Keys List + */ + export type KeyList = { /** - * Client name. + * Total number of keys that matched your query. */ - clientName: string; + total: number; /** - * Client version. + * List of keys. */ - clientVersion: string; + keys: Key[]; + } + + /** + * Dev Keys List + */ + export type DevKeyList = { /** - * Client engine name. + * Total number of devKeys that matched your query. */ - clientEngine: string; + total: number; /** - * Client engine name. + * List of devKeys. */ - clientEngineVersion: string; + devKeys: DevKey[]; + } + + /** + * Platforms List + */ + export type PlatformList = { /** - * Device name. + * Total number of platforms that matched your query. */ - deviceName: string; + total: number; /** - * Device brand name. + * List of platforms. */ - deviceBrand: string; + platforms: Platform[]; + } + + /** + * Countries List + */ + export type CountryList = { /** - * Device model name. + * Total number of countries that matched your query. */ - deviceModel: string; - /** - * Country two-character ISO 3166-1 alpha code. - */ - countryCode: string; + total: number; /** - * Country name. + * List of countries. */ - countryName: string; + countries: Country[]; + } + + /** + * Continents List + */ + export type ContinentList = { /** - * Returns true if this the current user session. + * Total number of continents that matched your query. */ - current: boolean; + total: number; /** - * Returns a list of active session factors. + * List of continents. */ - factors: string[]; + continents: Continent[]; + } + + /** + * Languages List + */ + export type LanguageList = { /** - * Secret used to authenticate the user. Only included if the request was made with an API key + * Total number of languages that matched your query. */ - secret: string; + total: number; /** - * Most recent date in ISO 8601 format when the session successfully passed MFA challenge. + * List of languages. */ - mfaUpdatedAt: string; + languages: Language[]; } /** - * MFAFactors + * Currencies List */ - export type MfaFactors = { + export type CurrencyList = { /** - * Can TOTP be used for MFA challenge for this account. + * Total number of currencies that matched your query. */ - totp: boolean; + total: number; /** - * Can phone (SMS) be used for MFA challenge for this account. + * List of currencies. */ - phone: boolean; + currencies: Currency[]; + } + + /** + * Phones List + */ + export type PhoneList = { /** - * Can email be used for MFA challenge for this account. + * Total number of phones that matched your query. */ - email: boolean; + total: number; /** - * Can recovery code be used for MFA challenge for this account. + * List of phones. */ - recoveryCode: boolean; + phones: Phone[]; } /** - * MFA Recovery Codes + * Variables List */ - export type MfaRecoveryCodes = { + export type VariableList = { /** - * Recovery codes. + * Total number of variables that matched your query. */ - recoveryCodes: string[]; + total: number; + /** + * List of variables. + */ + variables: Variable[]; } /** - * Payment methods list + * Status List */ - export type PaymentMethodList = { + export type HealthStatusList = { /** - * Total number of paymentMethods that matched your query. + * Total number of statuses that matched your query. */ total: number; /** - * List of paymentMethods. + * List of statuses. */ - paymentMethods: PaymentMethod[]; + statuses: HealthStatus[]; } /** - * paymentMethod + * Rule List */ - export type PaymentMethod = { + export type ProxyRuleList = { /** - * Payment Method ID. + * Total number of rules that matched your query. */ - $id: string; + total: number; /** - * Payment method creation time in ISO 8601 format. + * List of rules. */ - $createdAt: string; + rules: ProxyRule[]; + } + + /** + * Schedules List + */ + export type ScheduleList = { /** - * Payment method update date in ISO 8601 format. + * Total number of schedules that matched your query. */ - $updatedAt: string; + total: number; /** - * Payment method permissions. [Learn more about permissions](/docs/permissions). + * List of schedules. */ - $permissions: string[]; + schedules: Schedule[]; + } + + /** + * Locale codes list + */ + export type LocaleCodeList = { /** - * Payment method ID from the payment provider + * Total number of localeCodes that matched your query. */ - providerMethodId: string; + total: number; /** - * Client secret hash for payment setup + * List of localeCodes. */ - clientSecret: string; + localeCodes: LocaleCode[]; + } + + /** + * Provider list + */ + export type ProviderList = { /** - * User ID from the payment provider. + * Total number of providers that matched your query. */ - providerUserId: string; + total: number; /** - * ID of the Team. + * List of providers. */ - userId: string; + providers: Provider[]; + } + + /** + * Message list + */ + export type MessageList = { /** - * Expiry month of the payment method. + * Total number of messages that matched your query. */ - expiryMonth: number; + total: number; /** - * Expiry year of the payment method. + * List of messages. */ - expiryYear: number; + messages: Message[]; + } + + /** + * Topic list + */ + export type TopicList = { /** - * Last 4 digit of the payment method + * Total number of topics that matched your query. */ - last4: string; + total: number; /** - * Payment method brand + * List of topics. */ - brand: string; + topics: Topic[]; + } + + /** + * Subscriber list + */ + export type SubscriberList = { /** - * Name of the owner + * Total number of subscribers that matched your query. */ - name: string; + total: number; /** - * Mandate ID of the payment method + * List of subscribers. */ - mandateId: string; + subscribers: Subscriber[]; + } + + /** + * Target list + */ + export type TargetList = { /** - * Country of the payment method + * Total number of targets that matched your query. */ - country: string; + total: number; /** - * State of the payment method + * List of targets. */ - state: string; + targets: Target[]; + } + + /** + * Transaction List + */ + export type TransactionList = { /** - * Last payment error associated with the payment method. + * Total number of transactions that matched your query. */ - lastError: string; + total: number; /** - * True when it's the default payment method. + * List of transactions. */ - default: boolean; + transactions: Transaction[]; + } + + /** + * Migrations List + */ + export type MigrationList = { /** - * True when payment method has expired. + * Total number of migrations that matched your query. */ - expired: boolean; + total: number; /** - * True when payment method has failed to process multiple times. + * List of migrations. */ - failed: boolean; + migrations: Migration[]; } /** - * Preferences + * Specifications List */ - export type Preferences = { + export type SpecificationList = { + /** + * Total number of specifications that matched your query. + */ + total: number; + /** + * List of specifications. + */ + specifications: Specification[]; } - export type DefaultPreferences = Preferences & { - [key: string]: any; - [__default]: true; - }; - /** - * Token + * VCS Content List */ - export type Token = { - /** - * Token ID. - */ - $id: string; + export type VcsContentList = { /** - * Token creation date in ISO 8601 format. + * Total number of contents that matched your query. */ - $createdAt: string; + total: number; /** - * User ID. + * List of contents. */ - userId: string; + contents: VcsContent[]; + } + + /** + * Database + */ + export type Database = { /** - * Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. + * Database ID. */ - secret: string; + $id: string; /** - * Token expiration date in ISO 8601 format. + * Database name. */ - expire: string; + name: string; /** - * Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email. + * Database creation date in ISO 8601 format. */ - phrase: string; - } - - /** - * Sessions List - */ - export type SessionList = { + $createdAt: string; /** - * Total number of sessions that matched your query. + * Database update date in ISO 8601 format. */ - total: number; + $updatedAt: string; /** - * List of sessions. + * If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys. */ - sessions: Session[]; + enabled: boolean; + /** + * Database type. + */ + type: DatabaseType; + /** + * Database backup policies. + */ + policies: Index[]; + /** + * Database backup archives. + */ + archives: Collection[]; } /** - * Target + * Collection */ - export type Target = { + export type Collection = { /** - * Target ID. + * Collection ID. */ $id: string; /** - * Target creation time in ISO 8601 format. + * Collection creation date in ISO 8601 format. */ $createdAt: string; /** - * Target update date in ISO 8601 format. + * Collection update date in ISO 8601 format. */ $updatedAt: string; /** - * Target Name. + * Collection permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + */ + $permissions: string[]; + /** + * Database ID. + */ + databaseId: string; + /** + * Collection name. */ name: string; /** - * User ID. + * Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys. */ - userId: string; + enabled: boolean; /** - * Provider ID. + * Whether document-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). */ - providerId?: string; + documentSecurity: boolean; /** - * The target provider type. Can be one of the following: `email`, `sms` or `push`. + * Collection attributes. */ - providerType: string; + attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributePoint | Models.AttributeLine | Models.AttributePolygon | Models.AttributeVarchar | Models.AttributeText | Models.AttributeMediumtext | Models.AttributeLongtext | Models.AttributeString)[]; /** - * The target identifier. + * Collection indexes. */ - identifier: string; + indexes: Index[]; /** - * Is the target expired. + * Maximum document size in bytes. Returns 0 when no limit applies. */ - expired: boolean; + bytesMax: number; + /** + * Currently used document size in bytes based on defined attributes. + */ + bytesUsed: number; } /** - * Activity event list + * Attributes List */ - export type ActivityEventList = { + export type AttributeList = { /** - * Total number of events that matched your query. + * Total number of attributes in the given collection. */ total: number; /** - * List of events. + * List of attributes. */ - events: ActivityEvent[]; + attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributePoint | Models.AttributeLine | Models.AttributePolygon | Models.AttributeVarchar | Models.AttributeText | Models.AttributeMediumtext | Models.AttributeLongtext | Models.AttributeString)[]; } /** - * ActivityEvent + * AttributeString */ - export type ActivityEvent = { + export type AttributeString = { /** - * Event ID. + * Attribute Key. */ - $id: string; + key: string; /** - * User type. + * Attribute type. */ - userType: string; + type: string; /** - * User ID. + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - userId: string; + status: AttributeStatus; /** - * User Email. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ - userEmail: string; + error: string; /** - * User Name. + * Is attribute required? */ - userName: string; + required: boolean; /** - * Resource parent. + * Is attribute an array? */ - resourceParent: string; + array?: boolean; /** - * Resource type. + * Attribute creation date in ISO 8601 format. */ - resourceType: string; + $createdAt: string; /** - * Resource ID. + * Attribute update date in ISO 8601 format. */ - resourceId: string; + $updatedAt: string; /** - * Resource. + * Attribute size. */ - resource: string; + size: number; /** - * Event name. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - event: string; + default?: string; /** - * User agent. + * Defines whether this attribute is encrypted or not. */ - userAgent: string; + encrypt?: boolean; + } + + /** + * AttributeInteger + */ + export type AttributeInteger = { /** - * IP address. + * Attribute Key. */ - ip: string; + key: string; /** - * API mode when event triggered. + * Attribute type. */ - mode: string; + type: string; /** - * Location. + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - country: string; + status: AttributeStatus; /** - * Log creation date in ISO 8601 format. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ - time: string; + error: string; /** - * Project ID. + * Is attribute required? */ - projectId: string; + required: boolean; /** - * Team ID. + * Is attribute an array? */ - teamId: string; + array?: boolean; /** - * Hostname. + * Attribute creation date in ISO 8601 format. */ - hostname: string; + $createdAt: string; /** - * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). + * Attribute update date in ISO 8601 format. */ - osCode: string; + $updatedAt: string; /** - * Operating system name. + * Minimum value to enforce for new documents. */ - osName: string; + min?: number | bigint; /** - * Operating system version. + * Maximum value to enforce for new documents. */ - osVersion: string; + max?: number | bigint; /** - * Client type. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - clientType: string; + default?: number; + } + + /** + * AttributeFloat + */ + export type AttributeFloat = { /** - * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). + * Attribute Key. */ - clientCode: string; + key: string; /** - * Client name. + * Attribute type. */ - clientName: string; + type: string; /** - * Client version. + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - clientVersion: string; + status: AttributeStatus; /** - * Client engine name. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ - clientEngine: string; + error: string; /** - * Client engine name. + * Is attribute required? */ - clientEngineVersion: string; + required: boolean; /** - * Device name. + * Is attribute an array? */ - deviceName: string; + array?: boolean; /** - * Device brand name. + * Attribute creation date in ISO 8601 format. */ - deviceBrand: string; + $createdAt: string; /** - * Device model name. + * Attribute update date in ISO 8601 format. */ - deviceModel: string; + $updatedAt: string; /** - * Country two-character ISO 3166-1 alpha code. + * Minimum value to enforce for new documents. */ - countryCode: string; + min?: number; /** - * Country name. + * Maximum value to enforce for new documents. */ - countryName: string; + max?: number; + /** + * Default value for attribute when not provided. Cannot be set when attribute is required. + */ + default?: number; } /** - * Backup archive list + * AttributeBoolean */ - export type BackupArchiveList = { + export type AttributeBoolean = { /** - * Total number of archives that matched your query. + * Attribute Key. */ - total: number; + key: string; /** - * List of archives. + * Attribute type. */ - archives: BackupArchive[]; - } - - /** - * Archive - */ - export type BackupArchive = { + type: string; /** - * Archive ID. + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - $id: string; + status: AttributeStatus; /** - * Archive creation time in ISO 8601 format. + * Error message. Displays error generated on failure of creating or deleting an attribute. + */ + error: string; + /** + * Is attribute required? + */ + required: boolean; + /** + * Is attribute an array? + */ + array?: boolean; + /** + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Archive update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * Archive policy ID. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - policyId: string; + default?: boolean; + } + + /** + * AttributeEmail + */ + export type AttributeEmail = { /** - * Archive size in bytes. + * Attribute Key. */ - size: number; + key: string; /** - * The status of the archive creation. Possible values: pending, processing, uploading, completed, failed. + * Attribute type. */ - status: string; + type: string; /** - * The backup start time. + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - startedAt: string; + status: AttributeStatus; /** - * Migration ID. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ - migrationId: string; + error: string; /** - * The services that are backed up by this archive. + * Is attribute required? */ - services: string[]; + required: boolean; /** - * The resources that are backed up by this archive. + * Is attribute an array? */ - resources: string[]; + array?: boolean; /** - * The resource ID to backup. Set only if this archive should backup a single resource. + * Attribute creation date in ISO 8601 format. */ - resourceId?: string; + $createdAt: string; /** - * The resource type to backup. Set only if this archive should backup a single resource. + * Attribute update date in ISO 8601 format. */ - resourceType?: string; - } - - /** - * Backup policy list - */ - export type BackupPolicyList = { + $updatedAt: string; /** - * Total number of policies that matched your query. + * String format. */ - total: number; + format: string; /** - * List of policies. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - policies: BackupPolicy[]; + default?: string; } /** - * backup + * AttributeEnum */ - export type BackupPolicy = { + export type AttributeEnum = { /** - * Backup policy ID. + * Attribute Key. */ - $id: string; + key: string; /** - * Backup policy name. + * Attribute type. */ - name: string; + type: string; /** - * Policy creation date in ISO 8601 format. + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - $createdAt: string; + status: AttributeStatus; /** - * Policy update date in ISO 8601 format. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ - $updatedAt: string; + error: string; /** - * The services that are backed up by this policy. + * Is attribute required? */ - services: string[]; + required: boolean; /** - * The resources that are backed up by this policy. + * Is attribute an array? */ - resources: string[]; + array?: boolean; /** - * The resource ID to backup. Set only if this policy should backup a single resource. + * Attribute creation date in ISO 8601 format. */ - resourceId?: string; + $createdAt: string; /** - * The resource type to backup. Set only if this policy should backup a single resource. + * Attribute update date in ISO 8601 format. */ - resourceType?: string; + $updatedAt: string; /** - * How many days to keep the backup before it will be automatically deleted. + * Array of elements in enumerated type. */ - retention: number; + elements: string[]; /** - * Policy backup schedule in CRON format. + * String format. */ - schedule: string; + format: string; /** - * Is this policy enabled. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - enabled: boolean; + default?: string; } /** - * Restoration + * AttributeIP */ - export type BackupRestoration = { - /** - * Restoration ID. - */ - $id: string; + export type AttributeIp = { /** - * Restoration creation time in ISO 8601 format. + * Attribute Key. */ - $createdAt: string; + key: string; /** - * Restoration update date in ISO 8601 format. + * Attribute type. */ - $updatedAt: string; + type: string; /** - * Backup archive ID. + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - archiveId: string; + status: AttributeStatus; /** - * Backup policy ID. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ - policyId: string; + error: string; /** - * The status of the restoration. Possible values: pending, downloading, processing, completed, failed. + * Is attribute required? */ - status: string; + required: boolean; /** - * The backup start time. + * Is attribute an array? */ - startedAt: string; + array?: boolean; /** - * Migration ID. + * Attribute creation date in ISO 8601 format. */ - migrationId: string; + $createdAt: string; /** - * The services that are backed up by this policy. + * Attribute update date in ISO 8601 format. */ - services: string[]; + $updatedAt: string; /** - * The resources that are backed up by this policy. + * String format. */ - resources: string[]; + format: string; /** - * Optional data in key-value object. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - options: string; + default?: string; } /** - * Backup restoration list + * AttributeURL */ - export type BackupRestorationList = { + export type AttributeUrl = { /** - * Total number of restorations that matched your query. + * Attribute Key. */ - total: number; + key: string; /** - * List of restorations. + * Attribute type. */ - restorations: BackupRestoration[]; - } - - /** - * Campaign - */ - export type Campaign = { + type: string; /** - * Campaign ID + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - $id: string; + status: AttributeStatus; /** - * Campaign template + * Error message. Displays error generated on failure of creating or deleting an attribute. */ - template: string; + error: string; /** - * Campaign title + * Is attribute required? */ - title: string; + required: boolean; /** - * Campaign description + * Is attribute an array? */ - description: string; + array?: boolean; /** - * Billing plan campaign is associated with + * Attribute creation date in ISO 8601 format. */ - plan?: string; + $createdAt: string; /** - * Campaign CTA + * Attribute update date in ISO 8601 format. */ - cta?: string; + $updatedAt: string; /** - * Campaign info when claimed + * String format. */ - claimed?: string; + format: string; /** - * Campaign infor when unclaimed + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - unclaimed?: string; + default?: string; + } + + /** + * AttributeDatetime + */ + export type AttributeDatetime = { /** - * Campaign images + * Attribute Key. */ - image?: object; + key: string; /** - * Campaign reviews + * Attribute type. */ - reviews?: Review[]; + type: string; /** - * Campaign valid only for new orgs. + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - onlyNewOrgs?: boolean; + status: AttributeStatus; /** - * Is footer + * Error message. Displays error generated on failure of creating or deleting an attribute. */ - footer?: boolean; - } - - /** - * Billing plan list - */ - export type BillingPlanList = { + error: string; /** - * Total number of plans that matched your query. + * Is attribute required? */ - total: number; + required: boolean; /** - * List of plans. + * Is attribute an array? */ - plans: BillingPlan[]; - } - - /** - * billingPlan - */ - export type BillingPlan = { + array?: boolean; /** - * Plan ID. + * Attribute creation date in ISO 8601 format. */ - $id: string; + $createdAt: string; /** - * Plan name + * Attribute update date in ISO 8601 format. */ - name: string; + $updatedAt: string; /** - * Plan description + * ISO 8601 format. */ - desc: string; + format: string; /** - * Plan order + * Default value for attribute when not provided. Only null is optional */ - order: number; + default?: string; + } + + /** + * AttributeRelationship + */ + export type AttributeRelationship = { /** - * Price + * Attribute Key. */ - price: number; + key: string; /** - * Trial days + * Attribute type. */ - trial: number; + type: string; /** - * Bandwidth + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - bandwidth: number; + status: AttributeStatus; /** - * Storage + * Error message. Displays error generated on failure of creating or deleting an attribute. */ - storage: number; + error: string; /** - * Image Transformations + * Is attribute required? */ - imageTransformations: number; + required: boolean; /** - * Screenshots generated + * Is attribute an array? */ - screenshotsGenerated: number; + array?: boolean; /** - * Members + * Attribute creation date in ISO 8601 format. */ - members: number; + $createdAt: string; /** - * Webhooks + * Attribute update date in ISO 8601 format. */ - webhooks: number; + $updatedAt: string; /** - * Projects + * The ID of the related collection. */ - projects: number; + relatedCollection: string; /** - * Platforms + * The type of the relationship. */ - platforms: number; + relationType: string; /** - * Users + * Is the relationship two-way? */ - users: number; + twoWay: boolean; /** - * Teams + * The key of the two-way relationship. */ - teams: number; + twoWayKey: string; /** - * Databases + * How deleting the parent document will propagate to child documents. */ - databases: number; + onDelete: string; /** - * Database reads per month + * Whether this is the parent or child side of the relationship */ - databasesReads: number; + side: string; + } + + /** + * AttributePoint + */ + export type AttributePoint = { /** - * Database writes per month + * Attribute Key. */ - databasesWrites: number; + key: string; /** - * Database batch size limit + * Attribute type. */ - databasesBatchSize: number; + type: string; /** - * Buckets + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - buckets: number; + status: AttributeStatus; /** - * File size + * Error message. Displays error generated on failure of creating or deleting an attribute. */ - fileSize: number; + error: string; /** - * Functions + * Is attribute required? */ - functions: number; + required: boolean; /** - * Sites + * Is attribute an array? */ - sites: number; + array?: boolean; /** - * Function executions + * Attribute creation date in ISO 8601 format. */ - executions: number; + $createdAt: string; /** - * Rolling max executions retained per function/site + * Attribute update date in ISO 8601 format. */ - executionsRetentionCount: number; + $updatedAt: string; /** - * GB hours for functions + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - GBHours: number; + default?: any[]; + } + + /** + * AttributeLine + */ + export type AttributeLine = { /** - * Realtime connections + * Attribute Key. */ - realtime: number; + key: string; /** - * Realtime messages + * Attribute type. */ - realtimeMessages: number; + type: string; /** - * Messages per month + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - messages: number; + status: AttributeStatus; /** - * Topics for messaging + * Error message. Displays error generated on failure of creating or deleting an attribute. */ - topics: number; + error: string; /** - * SMS authentications per month + * Is attribute required? */ - authPhone: number; + required: boolean; /** - * Custom domains + * Is attribute an array? */ - domains: number; + array?: boolean; /** - * Log days + * Attribute creation date in ISO 8601 format. */ - logs: number; + $createdAt: string; /** - * Number of days of console inactivity before a project is paused. 0 means pausing is disabled. + * Attribute update date in ISO 8601 format. */ - projectInactivityDays: number; + $updatedAt: string; /** - * Alert threshold percentage + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - alertLimit: number; + default?: any[]; + } + + /** + * AttributePolygon + */ + export type AttributePolygon = { /** - * Additional resources + * Attribute Key. */ - usage: UsageBillingPlan; + key: string; /** - * Addons + * Attribute type. */ - addons: BillingPlanAddon; + type: string; /** - * Budget cap enabled or disabled. + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - budgetCapEnabled: boolean; + status: AttributeStatus; /** - * Custom SMTP + * Error message. Displays error generated on failure of creating or deleting an attribute. */ - customSmtp: boolean; + error: string; /** - * Appwrite branding in email + * Is attribute required? */ - emailBranding: boolean; + required: boolean; /** - * Does plan require payment method + * Is attribute an array? */ - requiresPaymentMethod: boolean; + array?: boolean; /** - * Does plan require billing address + * Attribute creation date in ISO 8601 format. */ - requiresBillingAddress: boolean; + $createdAt: string; /** - * Is the billing plan available + * Attribute update date in ISO 8601 format. */ - isAvailable: boolean; + $updatedAt: string; /** - * Can user change the plan themselves + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - selfService: boolean; + default?: any[]; + } + + /** + * AttributeVarchar + */ + export type AttributeVarchar = { /** - * Does plan enable premium support + * Attribute Key. */ - premiumSupport: boolean; + key: string; /** - * Does plan support budget cap + * Attribute type. */ - budgeting: boolean; + type: string; /** - * Does plan support mock numbers + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - supportsMockNumbers: boolean; + status: AttributeStatus; /** - * Does plan support organization roles + * Error message. Displays error generated on failure of creating or deleting an attribute. */ - supportsOrganizationRoles: boolean; + error: string; /** - * Does plan support credit + * Is attribute required? */ - supportsCredits: boolean; + required: boolean; /** - * Does plan support backup policies. + * Is attribute an array? */ - backupsEnabled: boolean; + array?: boolean; /** - * Whether usage addons are calculated per project. + * Attribute creation date in ISO 8601 format. */ - usagePerProject: boolean; + $createdAt: string; /** - * How many policies does plan support - */ - backupPolicies: number; - /** - * Maximum function and site deployment size in MB - */ - deploymentSize: number; - /** - * Maximum function and site deployment size in MB - */ - buildSize: number; - /** - * Does the plan support encrypted string attributes or not. + * Attribute update date in ISO 8601 format. */ - databasesAllowEncrypt: boolean; + $updatedAt: string; /** - * Plan specific limits + * Attribute size. */ - limits?: BillingPlanLimits; + size: number; /** - * Group of this billing plan for variants + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - group: BillingPlanGroup; + default?: string; /** - * Details of the program this plan is a part of. + * Defines whether this attribute is encrypted or not. */ - program?: Program; + encrypt?: boolean; } /** - * Program + * AttributeText */ - export type Program = { - /** - * Program ID - */ - $id: string; - /** - * Program title - */ - title: string; - /** - * Program description - */ - description: string; - /** - * Program tag for highlighting on console - */ - tag: string; + export type AttributeText = { /** - * Program icon for highlighting on console + * Attribute Key. */ - icon: string; + key: string; /** - * URL for more information on this program + * Attribute type. */ - url: string; + type: string; /** - * Whether this program is active + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - active: boolean; + status: AttributeStatus; /** - * Whether this program is external + * Error message. Displays error generated on failure of creating or deleting an attribute. */ - external: boolean; + error: string; /** - * Billing plan ID that this is program is associated with. + * Is attribute required? */ - billingPlanId: string; - } - - /** - * Organization - */ - export type Organization = { + required: boolean; /** - * Team ID. + * Is attribute an array? */ - $id: string; + array?: boolean; /** - * Team creation date in ISO 8601 format. + * Attribute creation date in ISO 8601 format. */ $createdAt: string; /** - * Team update date in ISO 8601 format. + * Attribute update date in ISO 8601 format. */ $updatedAt: string; /** - * Team name. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - name: string; + default?: string; /** - * Total number of team members. + * Defines whether this attribute is encrypted or not. */ - total: number; + encrypt?: boolean; + } + + /** + * AttributeMediumtext + */ + export type AttributeMediumtext = { /** - * Team preferences as a key-value object + * Attribute Key. */ - prefs: Preferences; + key: string; /** - * Project budget limit + * Attribute type. */ - billingBudget: number; + type: string; /** - * Project budget limit + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - budgetAlerts: number[]; + status: AttributeStatus; /** - * Organization's billing plan ID. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ - billingPlan: string; + error: string; /** - * Organization's billing plan ID. + * Is attribute required? */ - billingPlanId: string; + required: boolean; /** - * Organization's billing plan. + * Is attribute an array? */ - billingPlanDetails: BillingPlan; + array?: boolean; /** - * Billing email set for the organization. + * Attribute creation date in ISO 8601 format. */ - billingEmail: string; + $createdAt: string; /** - * Billing cycle start date. + * Attribute update date in ISO 8601 format. */ - billingStartDate: string; + $updatedAt: string; /** - * Current invoice cycle start date. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - billingCurrentInvoiceDate: string; + default?: string; /** - * Next invoice cycle start date. + * Defines whether this attribute is encrypted or not. */ - billingNextInvoiceDate: string; + encrypt?: boolean; + } + + /** + * AttributeLongtext + */ + export type AttributeLongtext = { /** - * Start date of trial. + * Attribute Key. */ - billingTrialStartDate: string; + key: string; /** - * Number of trial days. + * Attribute type. */ - billingTrialDays: number; + type: string; /** - * Current active aggregation id. + * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - billingAggregationId: string; + status: AttributeStatus; /** - * Current active aggregation id. + * Error message. Displays error generated on failure of creating or deleting an attribute. */ - billingInvoiceId: string; + error: string; /** - * Default payment method. + * Is attribute required? */ - paymentMethodId: string; + required: boolean; /** - * Default payment method. + * Is attribute an array? */ - billingAddressId: string; + array?: boolean; /** - * Backup payment method. + * Attribute creation date in ISO 8601 format. */ - backupPaymentMethodId: string; + $createdAt: string; /** - * Team status. + * Attribute update date in ISO 8601 format. */ - status: string; + $updatedAt: string; /** - * Remarks on team status. + * Default value for attribute when not provided. Cannot be set when attribute is required. */ - remarks: string; + default?: string; /** - * Organization agreements + * Defines whether this attribute is encrypted or not. */ - agreementBAA: string; + encrypt?: boolean; + } + + /** + * Table + */ + export type Table = { /** - * Program manager's name. + * Table ID. */ - programManagerName: string; + $id: string; /** - * Program manager's calendar link. + * Table creation date in ISO 8601 format. */ - programManagerCalendar: string; + $createdAt: string; /** - * Program's discord channel name. + * Table update date in ISO 8601 format. */ - programDiscordChannelName: string; + $updatedAt: string; /** - * Program's discord channel URL. + * Table permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ - programDiscordChannelUrl: string; + $permissions: string[]; /** - * Billing limits reached + * Database ID. */ - billingLimits: BillingLimits; + databaseId: string; /** - * Billing plan selected for downgrade. + * Table name. */ - billingPlanDowngrade: string; + name: string; /** - * Tax Id + * Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys. */ - billingTaxId: string; + enabled: boolean; /** - * Marked for deletion + * Whether row-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). */ - markedForDeletion: boolean; + rowSecurity: boolean; /** - * Product with which the organization is associated (appwrite or imagine) + * Table columns. */ - platform: string; + columns: (Models.ColumnBoolean | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail | Models.ColumnEnum | Models.ColumnUrl | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship | Models.ColumnPoint | Models.ColumnLine | Models.ColumnPolygon | Models.ColumnVarchar | Models.ColumnText | Models.ColumnMediumtext | Models.ColumnLongtext | Models.ColumnString)[]; /** - * Selected projects + * Table indexes. */ - projects: string[]; - } - - /** - * Regions list - */ - export type ConsoleRegionList = { + indexes: ColumnIndex[]; /** - * Total number of regions that matched your query. + * Maximum row size in bytes. Returns 0 when no limit applies. */ - total: number; + bytesMax: number; /** - * List of regions. + * Currently used row size in bytes based on defined columns. */ - regions: ConsoleRegion[]; + bytesUsed: number; } /** @@ -1568,457 +1713,419 @@ export namespace Models { } /** - * Column Indexes List + * ColumnString */ - export type ColumnIndexList = { + export type ColumnString = { /** - * Total number of indexes that matched your query. + * Column Key. */ - total: number; + key: string; /** - * List of indexes. + * Column type. */ - indexes: ColumnIndex[]; - } - - /** - * Console Variables - */ - export type ConsoleVariables = { + type: string; /** - * CNAME target for your Appwrite custom domains. + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - _APP_DOMAIN_TARGET_CNAME: string; + status: ColumnStatus; /** - * A target for your Appwrite custom domains. + * Error message. Displays error generated on failure of creating or deleting an column. */ - _APP_DOMAIN_TARGET_A: string; + error: string; /** - * Maximum build timeout in seconds. + * Is column required? */ - _APP_COMPUTE_BUILD_TIMEOUT: number; + required: boolean; /** - * AAAA target for your Appwrite custom domains. + * Is column an array? */ - _APP_DOMAIN_TARGET_AAAA: string; + array?: boolean; /** - * CAA target for your Appwrite custom domains. + * Column creation date in ISO 8601 format. */ - _APP_DOMAIN_TARGET_CAA: string; + $createdAt: string; /** - * Maximum file size allowed for file upload in bytes. + * Column update date in ISO 8601 format. */ - _APP_STORAGE_LIMIT: number; + $updatedAt: string; /** - * Maximum file size allowed for deployment in bytes. + * Column size. */ - _APP_COMPUTE_SIZE_LIMIT: number; + size: number; /** - * Defines if usage stats are enabled. This value is set to 'enabled' by default, to disable the usage stats set the value to 'disabled'. + * Default value for column when not provided. Cannot be set when column is required. */ - _APP_USAGE_STATS: string; + default?: string; /** - * Defines if VCS (Version Control System) is enabled. + * Defines whether this column is encrypted or not. */ - _APP_VCS_ENABLED: boolean; + encrypt?: boolean; + } + + /** + * ColumnInteger + */ + export type ColumnInteger = { /** - * Defines if main domain is configured. If so, custom domains can be created. + * Column Key. */ - _APP_DOMAIN_ENABLED: boolean; + key: string; /** - * Defines if AI assistant is enabled. + * Column type. */ - _APP_ASSISTANT_ENABLED: boolean; + type: string; /** - * A comma separated list of domains to use for site URLs. + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - _APP_DOMAIN_SITES: string; + status: ColumnStatus; /** - * A domain to use for function URLs. + * Error message. Displays error generated on failure of creating or deleting an column. */ - _APP_DOMAIN_FUNCTIONS: string; + error: string; /** - * Defines if HTTPS is enforced for all requests. + * Is column required? */ - _APP_OPTIONS_FORCE_HTTPS: string; + required: boolean; /** - * Comma-separated list of nameservers. + * Is column an array? */ - _APP_DOMAINS_NAMESERVERS: string; + array?: boolean; /** - * Database adapter in use. + * Column creation date in ISO 8601 format. */ - _APP_DB_ADAPTER: string; + $createdAt: string; /** - * Whether the database adapter supports relationships. + * Column update date in ISO 8601 format. */ - supportForRelationships: boolean; + $updatedAt: string; /** - * Whether the database adapter supports operators. + * Minimum value to enforce for new documents. */ - supportForOperators: boolean; + min?: number | bigint; /** - * Whether the database adapter supports spatial attributes. + * Maximum value to enforce for new documents. */ - supportForSpatials: boolean; + max?: number | bigint; /** - * Whether the database adapter supports spatial indexes on nullable columns. + * Default value for column when not provided. Cannot be set when column is required. */ - supportForSpatialIndexNull: boolean; + default?: number; + } + + /** + * ColumnFloat + */ + export type ColumnFloat = { /** - * Whether the database adapter supports fulltext wildcard search. + * Column Key. */ - supportForFulltextWildcard: boolean; + key: string; /** - * Whether the database adapter supports multiple fulltext indexes per collection. + * Column type. */ - supportForMultipleFulltextIndexes: boolean; + type: string; /** - * Whether the database adapter supports resizing attributes. + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - supportForAttributeResizing: boolean; + status: ColumnStatus; /** - * Whether the database adapter supports fixed schemas with row width limits. + * Error message. Displays error generated on failure of creating or deleting an column. */ - supportForSchemas: boolean; + error: string; /** - * Maximum index length supported by the database adapter. + * Is column required? */ - maxIndexLength: number; + required: boolean; /** - * Whether the database adapter uses integer sequence IDs. + * Is column an array? */ - supportForIntegerIds: boolean; - } - - /** - * Databases List - */ - export type DatabaseList = { + array?: boolean; /** - * Total number of databases that matched your query. + * Column creation date in ISO 8601 format. */ - total: number; + $createdAt: string; /** - * List of databases. + * Column update date in ISO 8601 format. */ - databases: Database[]; + $updatedAt: string; + /** + * Minimum value to enforce for new documents. + */ + min?: number; + /** + * Maximum value to enforce for new documents. + */ + max?: number; + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + default?: number; } /** - * Database + * ColumnBoolean */ - export type Database = { + export type ColumnBoolean = { /** - * Database ID. + * Column Key. */ - $id: string; + key: string; /** - * Database name. + * Column type. */ - name: string; + type: string; /** - * Database creation date in ISO 8601 format. + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - $createdAt: string; + status: ColumnStatus; /** - * Database update date in ISO 8601 format. + * Error message. Displays error generated on failure of creating or deleting an column. */ - $updatedAt: string; + error: string; /** - * If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys. + * Is column required? */ - enabled: boolean; + required: boolean; /** - * Database type. + * Is column an array? */ - type: DatabaseType; + array?: boolean; /** - * Database backup policies. + * Column creation date in ISO 8601 format. */ - policies: Index[]; + $createdAt: string; /** - * Database backup archives. + * Column update date in ISO 8601 format. */ - archives: Collection[]; + $updatedAt: string; + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + default?: boolean; } /** - * Transaction List + * ColumnEmail */ - export type TransactionList = { + export type ColumnEmail = { /** - * Total number of transactions that matched your query. + * Column Key. */ - total: number; + key: string; /** - * List of transactions. + * Column type. */ - transactions: Transaction[]; - } - - /** - * Transaction - */ - export type Transaction = { + type: string; /** - * Transaction ID. + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - $id: string; + status: ColumnStatus; /** - * Transaction creation time in ISO 8601 format. + * Error message. Displays error generated on failure of creating or deleting an column. */ - $createdAt: string; + error: string; /** - * Transaction update date in ISO 8601 format. + * Is column required? */ - $updatedAt: string; + required: boolean; /** - * Current status of the transaction. One of: pending, committing, committed, rolled_back, failed. + * Is column an array? */ - status: string; + array?: boolean; /** - * Number of operations in the transaction. + * Column creation date in ISO 8601 format. */ - operations: number; + $createdAt: string; /** - * Expiration time in ISO 8601 format. + * Column update date in ISO 8601 format. */ - expiresAt: string; + $updatedAt: string; + /** + * String format. + */ + format: string; + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + default?: string; } /** - * UsageDatabases + * ColumnEnum */ - export type UsageDatabases = { + export type ColumnEnum = { /** - * Time range of the usage stats. + * Column Key. */ - range: string; + key: string; /** - * Total aggregated number of databases. + * Column type. */ - databasesTotal: number; + type: string; /** - * Total aggregated number of collections. + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - collectionsTotal: number; + status: ColumnStatus; /** - * Total aggregated number of tables. + * Error message. Displays error generated on failure of creating or deleting an column. */ - tablesTotal: number; + error: string; /** - * Total aggregated number of documents. - */ - documentsTotal: number; - /** - * Total aggregated number of rows. - */ - rowsTotal: number; - /** - * Total aggregated number of total databases storage in bytes. - */ - storageTotal: number; - /** - * Total number of databases reads. - */ - databasesReadsTotal: number; - /** - * Total number of databases writes. - */ - databasesWritesTotal: number; - /** - * Aggregated number of databases per period. - */ - databases: Metric[]; - /** - * Aggregated number of collections per period. - */ - collections: Metric[]; - /** - * Aggregated number of tables per period. - */ - tables: Metric[]; - /** - * Aggregated number of documents per period. + * Is column required? */ - documents: Metric[]; + required: boolean; /** - * Aggregated number of rows per period. + * Is column an array? */ - rows: Metric[]; + array?: boolean; /** - * An array of the aggregated number of databases storage in bytes per period. + * Column creation date in ISO 8601 format. */ - storage: Metric[]; + $createdAt: string; /** - * An array of aggregated number of database reads. + * Column update date in ISO 8601 format. */ - databasesReads: Metric[]; + $updatedAt: string; /** - * An array of aggregated number of database writes. + * Array of elements in enumerated type. */ - databasesWrites: Metric[]; - } - - /** - * Collections List - */ - export type CollectionList = { + elements: string[]; /** - * Total number of collections that matched your query. + * String format. */ - total: number; + format: string; /** - * List of collections. + * Default value for column when not provided. Cannot be set when column is required. */ - collections: Collection[]; + default?: string; } /** - * Collection + * ColumnIP */ - export type Collection = { - /** - * Collection ID. - */ - $id: string; - /** - * Collection creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Collection update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Collection permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - */ - $permissions: string[]; + export type ColumnIp = { /** - * Database ID. + * Column Key. */ - databaseId: string; + key: string; /** - * Collection name. + * Column type. */ - name: string; + type: string; /** - * Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys. + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - enabled: boolean; + status: ColumnStatus; /** - * Whether document-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). + * Error message. Displays error generated on failure of creating or deleting an column. */ - documentSecurity: boolean; + error: string; /** - * Collection attributes. + * Is column required? */ - attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributePoint | Models.AttributeLine | Models.AttributePolygon | Models.AttributeVarchar | Models.AttributeText | Models.AttributeMediumtext | Models.AttributeLongtext | Models.AttributeString)[]; + required: boolean; /** - * Collection indexes. + * Is column an array? */ - indexes: Index[]; + array?: boolean; /** - * Maximum document size in bytes. Returns 0 when no limit applies. + * Column creation date in ISO 8601 format. */ - bytesMax: number; + $createdAt: string; /** - * Currently used document size in bytes based on defined attributes. + * Column update date in ISO 8601 format. */ - bytesUsed: number; - } - - /** - * Attributes List - */ - export type AttributeList = { + $updatedAt: string; /** - * Total number of attributes in the given collection. + * String format. */ - total: number; + format: string; /** - * List of attributes. + * Default value for column when not provided. Cannot be set when column is required. */ - attributes: (Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributePoint | Models.AttributeLine | Models.AttributePolygon | Models.AttributeVarchar | Models.AttributeText | Models.AttributeMediumtext | Models.AttributeLongtext | Models.AttributeString)[]; + default?: string; } /** - * AttributeBoolean + * ColumnURL */ - export type AttributeBoolean = { + export type ColumnUrl = { /** - * Attribute Key. + * Column Key. */ key: string; /** - * Attribute type. + * Column type. */ type: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: AttributeStatus; + status: ColumnStatus; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Error message. Displays error generated on failure of creating or deleting an column. */ error: string; /** - * Is attribute required? + * Is column required? */ required: boolean; /** - * Is attribute an array? + * Is column an array? */ array?: boolean; /** - * Attribute creation date in ISO 8601 format. + * Column creation date in ISO 8601 format. */ $createdAt: string; /** - * Attribute update date in ISO 8601 format. + * Column update date in ISO 8601 format. */ $updatedAt: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * String format. */ - default?: boolean; + format: string; + /** + * Default value for column when not provided. Cannot be set when column is required. + */ + default?: string; } /** - * AttributeDatetime + * ColumnDatetime */ - export type AttributeDatetime = { + export type ColumnDatetime = { /** - * Attribute Key. + * Column Key. */ key: string; /** - * Attribute type. + * Column type. */ type: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: AttributeStatus; + status: ColumnStatus; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Error message. Displays error generated on failure of creating or deleting an column. */ error: string; /** - * Is attribute required? + * Is column required? */ required: boolean; /** - * Is attribute an array? + * Is column an array? */ array?: boolean; /** - * Attribute creation date in ISO 8601 format. + * Column creation date in ISO 8601 format. */ $createdAt: string; /** - * Attribute update date in ISO 8601 format. + * Column update date in ISO 8601 format. */ $updatedAt: string; /** @@ -2026,1240 +2133,1398 @@ export namespace Models { */ format: string; /** - * Default value for attribute when not provided. Only null is optional + * Default value for column when not provided. Only null is optional */ default?: string; } /** - * AttributeEmail + * ColumnRelationship */ - export type AttributeEmail = { + export type ColumnRelationship = { /** - * Attribute Key. + * Column Key. */ key: string; /** - * Attribute type. + * Column type. */ type: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: AttributeStatus; + status: ColumnStatus; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Error message. Displays error generated on failure of creating or deleting an column. */ error: string; /** - * Is attribute required? + * Is column required? */ required: boolean; /** - * Is attribute an array? + * Is column an array? */ array?: boolean; /** - * Attribute creation date in ISO 8601 format. + * Column creation date in ISO 8601 format. */ $createdAt: string; /** - * Attribute update date in ISO 8601 format. + * Column update date in ISO 8601 format. */ $updatedAt: string; /** - * String format. + * The ID of the related table. */ - format: string; + relatedTable: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * The type of the relationship. */ - default?: string; + relationType: string; + /** + * Is the relationship two-way? + */ + twoWay: boolean; + /** + * The key of the two-way relationship. + */ + twoWayKey: string; + /** + * How deleting the parent document will propagate to child documents. + */ + onDelete: string; + /** + * Whether this is the parent or child side of the relationship + */ + side: string; } /** - * AttributeEnum + * ColumnPoint */ - export type AttributeEnum = { + export type ColumnPoint = { /** - * Attribute Key. + * Column Key. */ key: string; /** - * Attribute type. + * Column type. */ type: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: AttributeStatus; + status: ColumnStatus; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Error message. Displays error generated on failure of creating or deleting an column. */ error: string; /** - * Is attribute required? + * Is column required? */ required: boolean; /** - * Is attribute an array? + * Is column an array? */ array?: boolean; /** - * Attribute creation date in ISO 8601 format. + * Column creation date in ISO 8601 format. */ $createdAt: string; /** - * Attribute update date in ISO 8601 format. + * Column update date in ISO 8601 format. */ $updatedAt: string; /** - * Array of elements in enumerated type. + * Default value for column when not provided. Cannot be set when column is required. */ - elements: string[]; - /** - * String format. - */ - format: string; - /** - * Default value for attribute when not provided. Cannot be set when attribute is required. - */ - default?: string; + default?: any[]; } /** - * AttributeFloat + * ColumnLine */ - export type AttributeFloat = { + export type ColumnLine = { /** - * Attribute Key. + * Column Key. */ key: string; /** - * Attribute type. + * Column type. */ type: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: AttributeStatus; + status: ColumnStatus; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Error message. Displays error generated on failure of creating or deleting an column. */ error: string; /** - * Is attribute required? + * Is column required? */ required: boolean; /** - * Is attribute an array? + * Is column an array? */ array?: boolean; /** - * Attribute creation date in ISO 8601 format. + * Column creation date in ISO 8601 format. */ $createdAt: string; /** - * Attribute update date in ISO 8601 format. + * Column update date in ISO 8601 format. */ $updatedAt: string; /** - * Minimum value to enforce for new documents. - */ - min?: number; - /** - * Maximum value to enforce for new documents. - */ - max?: number; - /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Default value for column when not provided. Cannot be set when column is required. */ - default?: number; + default?: any[]; } /** - * AttributeInteger + * ColumnPolygon */ - export type AttributeInteger = { + export type ColumnPolygon = { /** - * Attribute Key. + * Column Key. */ key: string; /** - * Attribute type. + * Column type. */ type: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: AttributeStatus; + status: ColumnStatus; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Error message. Displays error generated on failure of creating or deleting an column. */ error: string; /** - * Is attribute required? + * Is column required? */ required: boolean; /** - * Is attribute an array? + * Is column an array? */ array?: boolean; /** - * Attribute creation date in ISO 8601 format. + * Column creation date in ISO 8601 format. */ $createdAt: string; /** - * Attribute update date in ISO 8601 format. + * Column update date in ISO 8601 format. */ $updatedAt: string; /** - * Minimum value to enforce for new documents. - */ - min?: number | bigint; - /** - * Maximum value to enforce for new documents. - */ - max?: number | bigint; - /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Default value for column when not provided. Cannot be set when column is required. */ - default?: number; + default?: any[]; } /** - * AttributeIP + * ColumnVarchar */ - export type AttributeIp = { + export type ColumnVarchar = { /** - * Attribute Key. + * Column Key. */ key: string; /** - * Attribute type. + * Column type. */ type: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: AttributeStatus; + status: ColumnStatus; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Error message. Displays error generated on failure of creating or deleting an column. */ error: string; /** - * Is attribute required? + * Is column required? */ required: boolean; /** - * Is attribute an array? + * Is column an array? */ array?: boolean; /** - * Attribute creation date in ISO 8601 format. + * Column creation date in ISO 8601 format. */ $createdAt: string; /** - * Attribute update date in ISO 8601 format. + * Column update date in ISO 8601 format. */ $updatedAt: string; /** - * String format. + * Column size. */ - format: string; + size: number; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Default value for column when not provided. Cannot be set when column is required. */ default?: string; + /** + * Defines whether this column is encrypted or not. + */ + encrypt?: boolean; } /** - * AttributeLine + * ColumnText */ - export type AttributeLine = { + export type ColumnText = { /** - * Attribute Key. + * Column Key. */ key: string; /** - * Attribute type. + * Column type. */ type: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: AttributeStatus; + status: ColumnStatus; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Error message. Displays error generated on failure of creating or deleting an column. */ error: string; /** - * Is attribute required? + * Is column required? */ required: boolean; /** - * Is attribute an array? + * Is column an array? */ array?: boolean; /** - * Attribute creation date in ISO 8601 format. + * Column creation date in ISO 8601 format. */ $createdAt: string; /** - * Attribute update date in ISO 8601 format. + * Column update date in ISO 8601 format. */ $updatedAt: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Default value for column when not provided. Cannot be set when column is required. */ - default?: any[]; + default?: string; + /** + * Defines whether this column is encrypted or not. + */ + encrypt?: boolean; } /** - * AttributeLongtext + * ColumnMediumtext */ - export type AttributeLongtext = { + export type ColumnMediumtext = { /** - * Attribute Key. + * Column Key. */ key: string; /** - * Attribute type. + * Column type. */ type: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: AttributeStatus; + status: ColumnStatus; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Error message. Displays error generated on failure of creating or deleting an column. */ error: string; /** - * Is attribute required? + * Is column required? */ required: boolean; /** - * Is attribute an array? + * Is column an array? */ array?: boolean; /** - * Attribute creation date in ISO 8601 format. + * Column creation date in ISO 8601 format. */ $createdAt: string; /** - * Attribute update date in ISO 8601 format. + * Column update date in ISO 8601 format. */ $updatedAt: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Default value for column when not provided. Cannot be set when column is required. */ default?: string; /** - * Defines whether this attribute is encrypted or not. + * Defines whether this column is encrypted or not. */ encrypt?: boolean; } /** - * AttributeMediumtext + * ColumnLongtext */ - export type AttributeMediumtext = { + export type ColumnLongtext = { /** - * Attribute Key. + * Column Key. */ key: string; /** - * Attribute type. + * Column type. */ type: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - status: AttributeStatus; + status: ColumnStatus; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Error message. Displays error generated on failure of creating or deleting an column. */ error: string; /** - * Is attribute required? + * Is column required? */ required: boolean; /** - * Is attribute an array? + * Is column an array? */ array?: boolean; /** - * Attribute creation date in ISO 8601 format. + * Column creation date in ISO 8601 format. */ $createdAt: string; /** - * Attribute update date in ISO 8601 format. + * Column update date in ISO 8601 format. */ $updatedAt: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Default value for column when not provided. Cannot be set when column is required. */ default?: string; /** - * Defines whether this attribute is encrypted or not. + * Defines whether this column is encrypted or not. */ encrypt?: boolean; } /** - * AttributePoint + * Index */ - export type AttributePoint = { + export type Index = { /** - * Attribute Key. + * Index ID. */ - key: string; + $id: string; /** - * Attribute type. + * Index creation date in ISO 8601 format. */ - type: string; + $createdAt: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Index update date in ISO 8601 format. */ - status: AttributeStatus; + $updatedAt: string; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Index key. */ - error: string; + key: string; /** - * Is attribute required? + * Index type. */ - required: boolean; + type: string; /** - * Is attribute an array? + * Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - array?: boolean; + status: IndexStatus; /** - * Attribute creation date in ISO 8601 format. + * Error message. Displays error generated on failure of creating or deleting an index. */ - $createdAt: string; + error: string; /** - * Attribute update date in ISO 8601 format. + * Index attributes. */ - $updatedAt: string; + attributes: string[]; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Index attributes length. */ - default?: any[]; + lengths: number[]; + /** + * Index orders. + */ + orders?: string[]; } /** - * AttributePolygon + * Index */ - export type AttributePolygon = { + export type ColumnIndex = { /** - * Attribute Key. + * Index ID. */ - key: string; + $id: string; /** - * Attribute type. + * Index creation date in ISO 8601 format. */ - type: string; + $createdAt: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Index update date in ISO 8601 format. */ - status: AttributeStatus; + $updatedAt: string; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Index Key. */ - error: string; + key: string; /** - * Is attribute required? + * Index type. */ - required: boolean; + type: string; /** - * Is attribute an array? + * Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` */ - array?: boolean; + status: string; /** - * Attribute creation date in ISO 8601 format. + * Error message. Displays error generated on failure of creating or deleting an index. */ - $createdAt: string; + error: string; /** - * Attribute update date in ISO 8601 format. + * Index columns. */ - $updatedAt: string; + columns: string[]; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Index columns length. */ - default?: any[]; + lengths: number[]; + /** + * Index orders. + */ + orders?: string[]; } /** - * AttributeRelationship + * Row */ - export type AttributeRelationship = { + export type Row = { /** - * Attribute Key. + * Row ID. */ - key: string; + $id: string; /** - * Attribute type. + * Row sequence ID. */ - type: string; + $sequence: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Table ID. */ - status: AttributeStatus; + $tableId: string; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Database ID. */ - error: string; + $databaseId: string; /** - * Is attribute required? + * Row creation date in ISO 8601 format. */ - required: boolean; + $createdAt: string; /** - * Is attribute an array? + * Row update date in ISO 8601 format. */ - array?: boolean; + $updatedAt: string; /** - * Attribute creation date in ISO 8601 format. + * Row permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ - $createdAt: string; + $permissions: string[]; + } + + export type DefaultRow = Row & { + [key: string]: any; + [__default]: true; + }; + + /** + * Document + */ + export type Document = { /** - * Attribute update date in ISO 8601 format. + * Document ID. */ - $updatedAt: string; + $id: string; /** - * The ID of the related collection. + * Document sequence ID. */ - relatedCollection: string; + $sequence: string; /** - * The type of the relationship. + * Collection ID. */ - relationType: string; + $collectionId: string; /** - * Is the relationship two-way? + * Database ID. */ - twoWay: boolean; + $databaseId: string; /** - * The key of the two-way relationship. + * Document creation date in ISO 8601 format. */ - twoWayKey: string; + $createdAt: string; /** - * How deleting the parent document will propagate to child documents. + * Document update date in ISO 8601 format. */ - onDelete: string; + $updatedAt: string; /** - * Whether this is the parent or child side of the relationship + * Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ - side: string; + $permissions: string[]; } + export type DefaultDocument = Document & { + [key: string]: any; + [__default]: true; + }; + /** - * AttributeString + * Log */ - export type AttributeString = { + export type Log = { /** - * Attribute Key. + * Event name. */ - key: string; + event: string; /** - * Attribute type. + * User ID of the actor recorded for this log. During impersonation, this is the original impersonator, not the impersonated target user. */ - type: string; + userId: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * User email of the actor recorded for this log. During impersonation, this is the original impersonator. */ - status: AttributeStatus; + userEmail: string; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * User name of the actor recorded for this log. During impersonation, this is the original impersonator. */ - error: string; + userName: string; /** - * Is attribute required? + * API mode when event triggered. */ - required: boolean; + mode: string; /** - * Is attribute an array? + * IP session in use when the session was created. */ - array?: boolean; + ip: string; /** - * Attribute creation date in ISO 8601 format. + * Log creation date in ISO 8601 format. */ - $createdAt: string; + time: string; /** - * Attribute update date in ISO 8601 format. + * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). */ - $updatedAt: string; + osCode: string; /** - * Attribute size. + * Operating system name. */ - size: number; + osName: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Operating system version. */ - default?: string; + osVersion: string; /** - * Defines whether this attribute is encrypted or not. + * Client type. */ - encrypt?: boolean; - } - - /** - * AttributeText - */ - export type AttributeText = { + clientType: string; /** - * Attribute Key. + * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). */ - key: string; + clientCode: string; /** - * Attribute type. + * Client name. */ - type: string; + clientName: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Client version. */ - status: AttributeStatus; + clientVersion: string; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Client engine name. */ - error: string; + clientEngine: string; /** - * Is attribute required? + * Client engine name. */ - required: boolean; + clientEngineVersion: string; /** - * Is attribute an array? + * Device name. */ - array?: boolean; + deviceName: string; /** - * Attribute creation date in ISO 8601 format. + * Device brand name. */ - $createdAt: string; + deviceBrand: string; /** - * Attribute update date in ISO 8601 format. + * Device model name. */ - $updatedAt: string; + deviceModel: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Country two-character ISO 3166-1 alpha code. */ - default?: string; + countryCode: string; /** - * Defines whether this attribute is encrypted or not. + * Country name. */ - encrypt?: boolean; + countryName: string; } /** - * AttributeURL + * User */ - export type AttributeUrl = { + export type User = { /** - * Attribute Key. + * User ID. */ - key: string; + $id: string; /** - * Attribute type. + * User creation date in ISO 8601 format. */ - type: string; + $createdAt: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * User update date in ISO 8601 format. */ - status: AttributeStatus; + $updatedAt: string; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * User name. */ - error: string; + name: string; /** - * Is attribute required? + * Hashed user password. */ - required: boolean; + password?: string; /** - * Is attribute an array? + * Password hashing algorithm. */ - array?: boolean; + hash?: string; /** - * Attribute creation date in ISO 8601 format. + * Password hashing algorithm configuration. */ - $createdAt: string; + hashOptions?: object; /** - * Attribute update date in ISO 8601 format. + * User registration date in ISO 8601 format. */ - $updatedAt: string; + registration: string; /** - * String format. + * User status. Pass `true` for enabled and `false` for disabled. */ - format: string; + status: boolean; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Labels for the user. */ - default?: string; - } - - /** - * AttributeVarchar - */ - export type AttributeVarchar = { + labels: string[]; /** - * Attribute Key. + * Password update time in ISO 8601 format. */ - key: string; + passwordUpdate: string; /** - * Attribute type. + * User email address. */ - type: string; + email: string; /** - * Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * User phone number in E.164 format. */ - status: AttributeStatus; + phone: string; /** - * Error message. Displays error generated on failure of creating or deleting an attribute. + * Email verification status. */ - error: string; + emailVerification: boolean; /** - * Is attribute required? + * Phone verification status. */ - required: boolean; + phoneVerification: boolean; /** - * Is attribute an array? + * Multi factor authentication status. */ - array?: boolean; + mfa: boolean; /** - * Attribute creation date in ISO 8601 format. + * User preferences as a key-value object */ - $createdAt: string; + prefs: Preferences; /** - * Attribute update date in ISO 8601 format. + * A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider. */ - $updatedAt: string; + targets: Target[]; /** - * Attribute size. + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. */ - size: number; + accessedAt: string; /** - * Default value for attribute when not provided. Cannot be set when attribute is required. + * Whether the user can impersonate other users. */ - default?: string; + impersonator?: boolean; /** - * Defines whether this attribute is encrypted or not. + * ID of the original actor performing the impersonation. Present only when the current request is impersonating another user. Internal audit logs attribute the action to this user, while the impersonated target is recorded only in internal audit payload data. */ - encrypt?: boolean; + impersonatorUserId?: string; } /** - * Documents List + * AlgoMD5 */ - export type DocumentList = { + export type AlgoMd5 = { /** - * Total number of documents that matched your query. + * Algo type. */ - total: number; + type: string; + } + + /** + * AlgoSHA + */ + export type AlgoSha = { /** - * List of documents. + * Algo type. */ - documents: Document[]; + type: string; } /** - * Document + * AlgoPHPass */ - export type Document = { + export type AlgoPhpass = { /** - * Document ID. + * Algo type. */ - $id: string; + type: string; + } + + /** + * AlgoBcrypt + */ + export type AlgoBcrypt = { /** - * Document sequence ID. + * Algo type. */ - $sequence: string; + type: string; + } + + /** + * AlgoScrypt + */ + export type AlgoScrypt = { /** - * Collection ID. + * Algo type. */ - $collectionId: string; + type: string; /** - * Database ID. + * CPU complexity of computed hash. */ - $databaseId: string; + costCpu: number; /** - * Document creation date in ISO 8601 format. + * Memory complexity of computed hash. */ - $createdAt: string; + costMemory: number; /** - * Document update date in ISO 8601 format. + * Parallelization of computed hash. */ - $updatedAt: string; + costParallel: number; /** - * Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * Length used to compute hash. */ - $permissions: string[]; + length: number; } - export type DefaultDocument = Document & { - [key: string]: any; - [__default]: true; - }; - /** - * Indexes List + * AlgoScryptModified */ - export type IndexList = { + export type AlgoScryptModified = { /** - * Total number of indexes that matched your query. + * Algo type. */ - total: number; + type: string; /** - * List of indexes. + * Salt used to compute hash. */ - indexes: Index[]; + salt: string; + /** + * Separator used to compute hash. + */ + saltSeparator: string; + /** + * Key used to compute hash. + */ + signerKey: string; } /** - * Index + * AlgoArgon2 */ - export type Index = { + export type AlgoArgon2 = { /** - * Index ID. + * Algo type. */ - $id: string; + type: string; /** - * Index creation date in ISO 8601 format. + * Memory used to compute hash. */ - $createdAt: string; + memoryCost: number; /** - * Index update date in ISO 8601 format. + * Amount of time consumed to compute hash */ - $updatedAt: string; + timeCost: number; /** - * Index key. + * Number of threads used to compute hash. */ - key: string; + threads: number; + } + + /** + * Preferences + */ + export type Preferences = { + } + + export type DefaultPreferences = Preferences & { + [key: string]: any; + [__default]: true; + }; + + /** + * Session + */ + export type Session = { /** - * Index type. + * Session ID. */ - type: string; + $id: string; /** - * Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Session creation date in ISO 8601 format. */ - status: IndexStatus; + $createdAt: string; /** - * Error message. Displays error generated on failure of creating or deleting an index. + * Session update date in ISO 8601 format. */ - error: string; + $updatedAt: string; /** - * Index attributes. + * User ID. */ - attributes: string[]; + userId: string; /** - * Index attributes length. + * Session expiration date in ISO 8601 format. */ - lengths: number[]; + expire: string; /** - * Index orders. + * Session Provider. */ - orders?: string[]; - } - - /** - * UsageCollection - */ - export type UsageCollection = { + provider: string; /** - * Time range of the usage stats. + * Session Provider User ID. */ - range: string; + providerUid: string; /** - * Total aggregated number of of documents. + * Session Provider Access Token. */ - documentsTotal: number; + providerAccessToken: string; /** - * Aggregated number of documents per period. + * The date of when the access token expires in ISO 8601 format. */ - documents: Metric[]; - } - - /** - * UsageDatabase - */ - export type UsageDatabase = { + providerAccessTokenExpiry: string; /** - * Time range of the usage stats. + * Session Provider Refresh Token. */ - range: string; + providerRefreshToken: string; /** - * Total aggregated number of collections. + * IP in use when the session was created. */ - collectionsTotal: number; + ip: string; /** - * Total aggregated number of tables. + * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). */ - tablesTotal: number; + osCode: string; /** - * Total aggregated number of documents. + * Operating system name. */ - documentsTotal: number; + osName: string; /** - * Total aggregated number of rows. + * Operating system version. */ - rowsTotal: number; + osVersion: string; /** - * Total aggregated number of total storage used in bytes. + * Client type. */ - storageTotal: number; + clientType: string; /** - * Total number of databases reads. + * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). */ - databaseReadsTotal: number; + clientCode: string; /** - * Total number of databases writes. + * Client name. */ - databaseWritesTotal: number; + clientName: string; /** - * Aggregated number of collections per period. + * Client version. */ - collections: Metric[]; + clientVersion: string; /** - * Aggregated number of tables per period. + * Client engine name. */ - tables: Metric[]; + clientEngine: string; /** - * Aggregated number of documents per period. + * Client engine name. */ - documents: Metric[]; + clientEngineVersion: string; /** - * Aggregated number of rows per period. + * Device name. */ - rows: Metric[]; + deviceName: string; /** - * Aggregated storage used in bytes per period. + * Device brand name. */ - storage: Metric[]; + deviceBrand: string; /** - * An array of aggregated number of database reads. + * Device model name. */ - databaseReads: Metric[]; + deviceModel: string; /** - * An array of aggregated number of database writes. + * Country two-character ISO 3166-1 alpha code. */ - databaseWrites: Metric[]; - } - - /** - * Domains list - */ - export type DomainsList = { + countryCode: string; /** - * Total number of domains that matched your query. + * Country name. */ - total: number; + countryName: string; /** - * List of domains. + * Returns true if this the current user session. */ - domains: Domain[]; + current: boolean; + /** + * Returns a list of active session factors. + */ + factors: string[]; + /** + * Secret used to authenticate the user. Only included if the request was made with an API key + */ + secret: string; + /** + * Most recent date in ISO 8601 format when the session successfully passed MFA challenge. + */ + mfaUpdatedAt: string; } /** - * Domain + * Identity */ - export type Domain = { + export type Identity = { /** - * Domain ID. + * Identity ID. */ $id: string; /** - * Domain creation time in ISO 8601 format. + * Identity creation date in ISO 8601 format. */ $createdAt: string; /** - * Domain update date in ISO 8601 format. + * Identity update date in ISO 8601 format. */ $updatedAt: string; /** - * Domain name. - */ - domain: string; - /** - * Domain registrar (e.g. "appwrite" or "third_party"). - */ - registrar: string; - /** - * Nameservers setting. "Appwrite" or empty string. - */ - nameservers: string; - /** - * Domain expiry date in ISO 8601 format. + * User ID. */ - expire: string; + userId: string; /** - * Domain renewal date in ISO 8601 format. + * Identity Provider. */ - renewal: string; + provider: string; /** - * If set to true, the domain will automatically renew. + * ID of the User in the Identity Provider. */ - autoRenewal: boolean; + providerUid: string; /** - * Renewal price (in cents). + * Email of the User in the Identity Provider. */ - renewalPrice: number; + providerEmail: string; /** - * Transfer status for domains being transferred in. + * Identity Provider Access Token. */ - transferStatus: DomainTransferStatusEnum; + providerAccessToken: string; /** - * Team ID. + * The date of when the access token expires in ISO 8601 format. */ - teamId: string; + providerAccessTokenExpiry: string; /** - * Dns records + * Identity Provider Refresh Token. */ - dnsRecords: DnsRecord[]; + providerRefreshToken: string; } /** - * DomainPrice + * Token */ - export type DomainPrice = { + export type Token = { /** - * Domain name. + * Token ID. */ - domain: string; + $id: string; /** - * Top-level domain for the requested domain. + * Token creation date in ISO 8601 format. */ - tld: string; + $createdAt: string; /** - * Whether the domain is currently available for registration. + * User ID. */ - available: boolean; + userId: string; /** - * Domain registration price. + * Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. */ - price: number; + secret: string; /** - * Price period in years. + * Token expiration date in ISO 8601 format. */ - periodYears: number; + expire: string; /** - * Whether the domain is a premium domain. + * Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email. */ - premium: boolean; + phrase: string; } /** - * DomainPurchase + * JWT */ - export type DomainPurchase = { - /** - * Purchase/invoice ID. - */ - $id: string; - /** - * Purchase creation time in ISO 8601 format. - */ - $createdAt: string; + export type Jwt = { /** - * Purchase update date in ISO 8601 format. + * JWT encoded string. */ - $updatedAt: string; + jwt: string; + } + + /** + * Locale + */ + export type Locale = { /** - * Domain document ID. + * User IP address. */ - domainId: string; + ip: string; /** - * Domain name. + * Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format */ - domain: string; + countryCode: string; /** - * Team ID that owns the domain. + * Country name. This field support localization. */ - organizationId: string; + country: string; /** - * Domain purchase status. + * Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America. */ - status: DomainPurchaseStatus; + continentCode: string; /** - * Stripe client secret for 3DS; empty when not applicable. + * Continent name. This field support localization. */ - clientSecret: string; + continent: string; /** - * Purchase amount. + * True if country is part of the European Union. */ - amount: number; + eu: boolean; /** - * Currency code. + * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format */ currency: string; } /** - * Domain suggestions list + * LocaleCode */ - export type DomainSuggestionsList = { - /** - * Total number of suggestions that matched your query. - */ - total: number; + export type LocaleCode = { /** - * List of suggestions. + * Locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) */ - suggestions: DomainSuggestion[]; - } - - /** - * domainTransferOut - */ - export type DomainTransferOut = { + code: string; /** - * Domain transfer authorization code. + * Locale name */ - authCode: string; + name: string; } /** - * DNS records list + * File */ - export type DnsRecordsList = { - /** - * Total number of dnsRecords that matched your query. - */ - total: number; + export type File = { /** - * List of dnsRecords. + * File ID. */ - dnsRecords: DnsRecord[]; - } - - /** - * DNSRecord - */ - export type DnsRecord = { + $id: string; /** - * DNS Record ID. + * Bucket ID. */ - $id: string; + bucketId: string; /** - * DNS Record creation time in ISO 8601 format. + * File creation date in ISO 8601 format. */ $createdAt: string; /** - * DNS Record update date in ISO 8601 format. + * File update date in ISO 8601 format. */ $updatedAt: string; /** - * DNS record type (e.g. A, CNAME, MX). + * File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ - type: string; + $permissions: string[]; /** - * Record name or subdomain. + * File name. */ name: string; /** - * Value of the record (IP address, domain, etc.). + * File MD5 signature. */ - value: string; + signature: string; /** - * Time to live (in seconds). + * File mime type. */ - ttl: number; + mimeType: string; /** - * Record priority (commonly used for MX). + * File original size in bytes. */ - priority: number; + sizeOriginal: number; /** - * Whether this record is locked (read-only). + * Total number of chunks available */ - lock: boolean; + chunksTotal: number; /** - * Record weight (used for SRV records). + * Total number of chunks uploaded */ - weight: number; + chunksUploaded: number; /** - * Target port (used for SRV records). + * Whether file contents are encrypted at rest. */ - port: number; + encryption: boolean; /** - * Comment for the DNS record. + * Compression algorithm used for the file. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd). */ - comment: string; + compression: string; } /** - * domainTransferStatus + * Bucket */ - export type DomainTransferStatus = { + export type Bucket = { /** - * Transfer status. + * Bucket ID. */ - status: DomainTransferStatusEnum; + $id: string; /** - * Additional transfer status information. + * Bucket creation time in ISO 8601 format. */ - reason: string; + $createdAt: string; /** - * Transfer status timestamp in ISO 8601 format. + * Bucket update date in ISO 8601 format. */ - timestamp: string; + $updatedAt: string; + /** + * Bucket permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + */ + $permissions: string[]; + /** + * Whether file-level security is enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). + */ + fileSecurity: boolean; + /** + * Bucket name. + */ + name: string; + /** + * Bucket enabled. + */ + enabled: boolean; + /** + * Maximum file size supported. + */ + maximumFileSize: number; + /** + * Allowed file extensions. + */ + allowedFileExtensions: string[]; + /** + * Compression algorithm chosen for compression. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd). + */ + compression: string; + /** + * Bucket is encrypted. + */ + encryption: boolean; + /** + * Virus scanning is enabled. + */ + antivirus: boolean; + /** + * Image transformations are enabled. + */ + transformations: boolean; + /** + * Total size of this bucket in bytes. + */ + totalSize: number; } /** - * Functions List + * ResourceToken */ - export type FunctionList = { + export type ResourceToken = { /** - * Total number of functions that matched your query. + * Token ID. + */ + $id: string; + /** + * Token creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Resource ID. + */ + resourceId: string; + /** + * Resource type. + */ + resourceType: string; + /** + * Token expiration date in ISO 8601 format. + */ + expire: string; + /** + * JWT encoded string. + */ + secret: string; + /** + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + */ + accessedAt: string; + } + + /** + * Team + */ + export type Team = { + /** + * Team ID. + */ + $id: string; + /** + * Team creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Team update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Team name. + */ + name: string; + /** + * Total number of team members. */ total: number; /** - * List of functions. + * Team preferences as a key-value object */ - functions: Function[]; + prefs: Preferences; } /** - * Function + * Membership */ - export type Function = { + export type Membership = { /** - * Function ID. + * Membership ID. */ $id: string; /** - * Function creation date in ISO 8601 format. + * Membership creation date in ISO 8601 format. */ $createdAt: string; /** - * Function update date in ISO 8601 format. + * Membership update date in ISO 8601 format. */ $updatedAt: string; /** - * Execution permissions. + * User ID. */ - execute: string[]; + userId: string; /** - * Function name. + * User name. Hide this attribute by toggling membership privacy in the Console. + */ + userName: string; + /** + * User email address. Hide this attribute by toggling membership privacy in the Console. + */ + userEmail: string; + /** + * Team ID. + */ + teamId: string; + /** + * Team name. + */ + teamName: string; + /** + * Date, the user has been invited to join the team in ISO 8601 format. + */ + invited: string; + /** + * Date, the user has accepted the invitation to join the team in ISO 8601 format. + */ + joined: string; + /** + * User confirmation status, true if the user has joined the team or false otherwise. + */ + confirm: boolean; + /** + * Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console. + */ + mfa: boolean; + /** + * User list of roles + */ + roles: string[]; + } + + /** + * Site + */ + export type Site = { + /** + * Site ID. + */ + $id: string; + /** + * Site creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Site update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Site name. */ name: string; /** - * Function enabled. + * Site enabled. */ enabled: boolean; /** - * Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration. + * Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration. */ live: boolean; /** - * When disabled, executions will exclude logs and errors, and will be slightly faster. + * When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. */ logging: boolean; /** - * Function execution and build runtime. + * Site framework. */ - runtime: string; + framework: string; /** * How many days to keep the non-active deployments before they will be automatically deleted. */ deploymentRetention: number; /** - * Function's active deployment ID. + * Site's active deployment ID. */ deploymentId: string; /** @@ -3267,7 +3532,15 @@ export namespace Models { */ deploymentCreatedAt: string; /** - * Function's latest deployment ID. + * Screenshot of active deployment with light theme preference file ID. + */ + deploymentScreenshotLight: string; + /** + * Screenshot of active deployment with dark theme preference file ID. + */ + deploymentScreenshotDark: string; + /** + * Site's latest deployment ID. */ latestDeploymentId: string; /** @@ -3279,39 +3552,31 @@ export namespace Models { */ latestDeploymentStatus: string; /** - * Allowed permission scopes. - */ - scopes: string[]; - /** - * Function variables. + * Site variables. */ vars: Variable[]; /** - * Function trigger events. - */ - events: string[]; - /** - * Function execution schedule in CRON format. + * Site request timeout in seconds. */ - schedule: string; + timeout: number; /** - * Function execution timeout in seconds. + * The install command used to install the site dependencies. */ - timeout: number; + installCommand: string; /** - * The entrypoint file used to execute the deployment. + * The build command used to build the site. */ - entrypoint: string; + buildCommand: string; /** - * The build command used to build the deployment. + * Custom command to use when starting site runtime. */ - commands: string; + startCommand: string; /** - * Version of Open Runtimes used for the function. + * The directory where the site build output is located. */ - version: string; + outputDirectory: string; /** - * Function VCS (Version Control System) installation id. + * Site VCS (Version Control System) installation id. */ installationId: string; /** @@ -3323,7 +3588,7 @@ export namespace Models { */ providerBranch: string; /** - * Path to function in VCS (Version Control System) repository + * Path to site in VCS (Version Control System) repository */ providerRootDirectory: string; /** @@ -3335,101 +3600,59 @@ export namespace Models { */ buildSpecification: string; /** - * Machine specification for executions. + * Machine specification for SSR executions. */ runtimeSpecification: string; - } - - /** - * Runtimes List - */ - export type RuntimeList = { /** - * Total number of runtimes that matched your query. + * Site build runtime. */ - total: number; + buildRuntime: string; /** - * List of runtimes. + * Site framework adapter. */ - runtimes: Runtime[]; + adapter: string; + /** + * Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. + */ + fallbackFile: string; } /** - * Specifications List + * Template Site */ - export type SpecificationList = { + export type TemplateSite = { /** - * Total number of specifications that matched your query. - */ - total: number; - /** - * List of specifications. - */ - specifications: Specification[]; - } - - /** - * Function Templates List - */ - export type TemplateFunctionList = { - /** - * Total number of templates that matched your query. - */ - total: number; - /** - * List of templates. - */ - templates: TemplateFunction[]; - } - - /** - * Template Function - */ - export type TemplateFunction = { - /** - * Function Template Icon. - */ - icon: string; - /** - * Function Template ID. + * Site Template ID. */ - id: string; + key: string; /** - * Function Template Name. + * Site Template Name. */ name: string; /** - * Function Template Tagline. + * Short description of template */ tagline: string; /** - * Execution permissions. - */ - permissions: string[]; - /** - * Function trigger events. + * URL hosting a template demo. */ - events: string[]; + demoUrl: string; /** - * Function execution schedult in CRON format. + * File URL with preview screenshot in dark theme preference. */ - cron: string; + screenshotDark: string; /** - * Function execution timeout in seconds. + * File URL with preview screenshot in light theme preference. */ - timeout: number; + screenshotLight: string; /** - * Function use cases. + * Site use cases. */ useCases: string[]; /** - * List of runtimes that can be used with this template. - */ - runtimes: TemplateRuntime[]; - /** - * Function Template Instructions. + * List of frameworks that can be used with this template. */ - instructions: string; + frameworks: TemplateFramework[]; /** * VCS (Version Control System) Provider. */ @@ -3447,2547 +3670,2627 @@ export namespace Models { */ providerVersion: string; /** - * Function variables. + * Site variables. */ variables: TemplateVariable[]; - /** - * Function scopes. - */ - scopes: string[]; } /** - * UsageFunctions + * Template Framework */ - export type UsageFunctions = { + export type TemplateFramework = { /** - * Time range of the usage stats. + * Parent framework key. */ - range: string; + key: string; /** - * Total aggregated number of functions. + * Framework Name. */ - functionsTotal: number; + name: string; /** - * Total aggregated number of functions deployments. + * The install command used to install the dependencies. */ - deploymentsTotal: number; + installCommand: string; /** - * Total aggregated sum of functions deployment storage. + * The build command used to build the deployment. */ - deploymentsStorageTotal: number; + buildCommand: string; /** - * Total aggregated number of functions build. + * The output directory to store the build output. */ - buildsTotal: number; + outputDirectory: string; /** - * total aggregated sum of functions build storage. + * Path to site in VCS (Version Control System) repository */ - buildsStorageTotal: number; + providerRootDirectory: string; /** - * Total aggregated sum of functions build compute time. + * Runtime used during build step of template. */ - buildsTimeTotal: number; + buildRuntime: string; /** - * Total aggregated sum of functions build mbSeconds. + * Site framework runtime */ - buildsMbSecondsTotal: number; + adapter: string; /** - * Total aggregated number of functions execution. + * Fallback file for SPA. Only relevant for static serve runtime. */ - executionsTotal: number; + fallbackFile: string; + } + + /** + * Function + */ + export type Function = { /** - * Total aggregated sum of functions execution compute time. + * Function ID. */ - executionsTimeTotal: number; + $id: string; /** - * Total aggregated sum of functions execution mbSeconds. + * Function creation date in ISO 8601 format. */ - executionsMbSecondsTotal: number; + $createdAt: string; /** - * Aggregated number of functions per period. + * Function update date in ISO 8601 format. */ - functions: Metric[]; + $updatedAt: string; /** - * Aggregated number of functions deployment per period. + * Execution permissions. */ - deployments: Metric[]; + execute: string[]; /** - * Aggregated number of functions deployment storage per period. + * Function name. */ - deploymentsStorage: Metric[]; + name: string; /** - * Total aggregated number of successful function builds. + * Function enabled. */ - buildsSuccessTotal: number; + enabled: boolean; /** - * Total aggregated number of failed function builds. + * Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration. */ - buildsFailedTotal: number; + live: boolean; /** - * Aggregated number of functions build per period. + * When disabled, executions will exclude logs and errors, and will be slightly faster. */ - builds: Metric[]; + logging: boolean; /** - * Aggregated sum of functions build storage per period. + * Function execution and build runtime. */ - buildsStorage: Metric[]; + runtime: string; /** - * Aggregated sum of functions build compute time per period. + * How many days to keep the non-active deployments before they will be automatically deleted. */ - buildsTime: Metric[]; + deploymentRetention: number; /** - * Aggregated sum of functions build mbSeconds per period. + * Function's active deployment ID. */ - buildsMbSeconds: Metric[]; + deploymentId: string; /** - * Aggregated number of functions execution per period. + * Active deployment creation date in ISO 8601 format. */ - executions: Metric[]; + deploymentCreatedAt: string; /** - * Aggregated number of functions execution compute time per period. + * Function's latest deployment ID. */ - executionsTime: Metric[]; + latestDeploymentId: string; /** - * Aggregated number of functions mbSeconds per period. + * Latest deployment creation date in ISO 8601 format. */ - executionsMbSeconds: Metric[]; + latestDeploymentCreatedAt: string; /** - * Aggregated number of successful function builds per period. + * Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed". */ - buildsSuccess: Metric[]; + latestDeploymentStatus: string; /** - * Aggregated number of failed function builds per period. + * Allowed permission scopes. */ - buildsFailed: Metric[]; - } - - /** - * Deployments List - */ - export type DeploymentList = { + scopes: string[]; /** - * Total number of deployments that matched your query. + * Function variables. */ - total: number; + vars: Variable[]; /** - * List of deployments. + * Function trigger events. */ - deployments: Deployment[]; - } - - /** - * Deployment - */ - export type Deployment = { + events: string[]; /** - * Deployment ID. + * Function execution schedule in CRON format. */ - $id: string; + schedule: string; /** - * Deployment creation date in ISO 8601 format. + * Function execution timeout in seconds. */ - $createdAt: string; + timeout: number; /** - * Deployment update date in ISO 8601 format. + * The entrypoint file used to execute the deployment. */ - $updatedAt: string; + entrypoint: string; /** - * Type of deployment. + * The build command used to build the deployment. */ - type: string; + commands: string; /** - * Resource ID. + * Version of Open Runtimes used for the function. */ - resourceId: string; + version: string; /** - * Resource type. + * Function VCS (Version Control System) installation id. */ - resourceType: string; + installationId: string; /** - * The entrypoint file to use to execute the deployment code. + * VCS (Version Control System) Repository ID */ - entrypoint: string; + providerRepositoryId: string; /** - * The code size in bytes. + * VCS (Version Control System) branch name */ - sourceSize: number; + providerBranch: string; /** - * The build output size in bytes. + * Path to function in VCS (Version Control System) repository */ - buildSize: number; + providerRootDirectory: string; /** - * The total size in bytes (source and build output). + * 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 */ - totalSize: number; + providerSilentMode: boolean; /** - * The current build ID. + * Machine specification for deployment builds. */ - buildId: string; + buildSpecification: string; /** - * Whether the deployment should be automatically activated. + * Machine specification for executions. */ - activate: boolean; + runtimeSpecification: string; + } + + /** + * Template Function + */ + export type TemplateFunction = { /** - * Screenshot with light theme preference file ID. + * Function Template Icon. */ - screenshotLight: string; + icon: string; /** - * Screenshot with dark theme preference file ID. + * Function Template ID. */ - screenshotDark: string; + id: string; /** - * The deployment status. Possible values are "waiting", "processing", "building", "ready", "canceled" and "failed". + * Function Template Name. */ - status: DeploymentStatus; + name: string; /** - * The build logs. + * Function Template Tagline. */ - buildLogs: string; + tagline: string; /** - * The current build time in seconds. + * Execution permissions. */ - buildDuration: number; + permissions: string[]; /** - * The name of the vcs provider repository + * Function trigger events. */ - providerRepositoryName: string; + events: string[]; /** - * The name of the vcs provider repository owner + * Function execution schedult in CRON format. */ - providerRepositoryOwner: string; + cron: string; /** - * The url of the vcs provider repository + * Function execution timeout in seconds. */ - providerRepositoryUrl: string; + timeout: number; /** - * The commit hash of the vcs commit + * Function use cases. */ - providerCommitHash: string; + useCases: string[]; /** - * The url of vcs commit author + * List of runtimes that can be used with this template. */ - providerCommitAuthorUrl: string; + runtimes: TemplateRuntime[]; /** - * The name of vcs commit author + * Function Template Instructions. */ - providerCommitAuthor: string; + instructions: string; /** - * The commit message + * VCS (Version Control System) Provider. */ - providerCommitMessage: string; + vcsProvider: string; /** - * The url of the vcs commit + * VCS (Version Control System) Repository ID */ - providerCommitUrl: string; + providerRepositoryId: string; /** - * The branch of the vcs repository + * VCS (Version Control System) Owner. */ - providerBranch: string; + providerOwner: string; /** - * The branch of the vcs repository + * VCS (Version Control System) branch version (tag). */ - providerBranchUrl: string; - } - - /** - * Executions List - */ - export type ExecutionList = { + providerVersion: string; /** - * Total number of executions that matched your query. + * Function variables. */ - total: number; + variables: TemplateVariable[]; /** - * List of executions. + * Function scopes. */ - executions: Execution[]; + scopes: string[]; } /** - * Execution + * Template Runtime */ - export type Execution = { - /** - * Execution ID. - */ - $id: string; + export type TemplateRuntime = { /** - * Execution creation date in ISO 8601 format. + * Runtime Name. */ - $createdAt: string; + name: string; /** - * Execution update date in ISO 8601 format. + * The build command used to build the deployment. */ - $updatedAt: string; + commands: string; /** - * Execution roles. + * The entrypoint file used to execute the deployment. */ - $permissions: string[]; + entrypoint: string; /** - * Function ID. + * Path to function in VCS (Version Control System) repository */ - functionId: string; + providerRootDirectory: string; + } + + /** + * Template Variable + */ + export type TemplateVariable = { /** - * Function's deployment ID used to create the execution. + * Variable Name. */ - deploymentId: string; + name: string; /** - * The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`. + * Variable Description. */ - trigger: ExecutionTrigger; + description: string; /** - * The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, `failed`, or `scheduled`. + * Variable Value. */ - status: ExecutionStatus; + value: string; /** - * HTTP request method type. + * Variable secret flag. Secret variables can only be updated or deleted, but never read. */ - requestMethod: string; + secret: boolean; /** - * HTTP request path and query. + * Variable Placeholder. */ - requestPath: string; + placeholder: string; /** - * HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. + * Is the variable required? */ - requestHeaders: Headers[]; + required: boolean; /** - * HTTP response status code. + * Variable Type. */ - responseStatusCode: number; + type: string; + } + + /** + * Installation + */ + export type Installation = { /** - * HTTP response body. This will return empty unless execution is created as synchronous. + * Function ID. */ - responseBody: string; + $id: string; /** - * HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. + * Function creation date in ISO 8601 format. */ - responseHeaders: Headers[]; + $createdAt: string; /** - * Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. + * Function update date in ISO 8601 format. */ - logs: string; + $updatedAt: string; /** - * Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. + * VCS (Version Control System) provider name. */ - errors: string; + provider: string; /** - * Resource(function/site) execution duration in seconds. + * VCS (Version Control System) organization name. */ - duration: number; + organization: string; /** - * The scheduled time for execution. If left empty, execution will be queued immediately. + * VCS (Version Control System) installation ID. */ - scheduledAt?: string; + providerInstallationId: string; } /** - * UsageFunction + * ProviderRepository */ - export type UsageFunction = { + export type ProviderRepository = { /** - * The time range of the usage stats. + * VCS (Version Control System) repository ID. */ - range: string; + id: string; /** - * Total aggregated number of function deployments. + * VCS (Version Control System) repository name. */ - deploymentsTotal: number; + name: string; /** - * Total aggregated sum of function deployments storage. + * VCS (Version Control System) organization name */ - deploymentsStorageTotal: number; + organization: string; /** - * Total aggregated number of function builds. + * VCS (Version Control System) provider name. */ - buildsTotal: number; + provider: string; /** - * Total aggregated number of successful function builds. + * Is VCS (Version Control System) repository private? */ - buildsSuccessTotal: number; + private: boolean; /** - * Total aggregated number of failed function builds. + * VCS (Version Control System) repository's default branch name. */ - buildsFailedTotal: number; + defaultBranch: string; /** - * total aggregated sum of function builds storage. + * VCS (Version Control System) installation ID. */ - buildsStorageTotal: number; + providerInstallationId: string; /** - * Total aggregated sum of function builds compute time. + * Is VCS (Version Control System) repository authorized for the installation? */ - buildsTimeTotal: number; + authorized: boolean; /** - * Average builds compute time. + * Last commit date in ISO 8601 format. */ - buildsTimeAverage: number; + pushedAt: string; /** - * Total aggregated sum of function builds mbSeconds. + * Environment variables found in .env files */ - buildsMbSecondsTotal: number; + variables: string[]; + } + + /** + * ProviderRepositoryFramework + */ + export type ProviderRepositoryFramework = { /** - * Total aggregated number of function executions. + * VCS (Version Control System) repository ID. */ - executionsTotal: number; + id: string; /** - * Total aggregated sum of function executions compute time. + * VCS (Version Control System) repository name. */ - executionsTimeTotal: number; + name: string; /** - * Total aggregated sum of function executions mbSeconds. + * VCS (Version Control System) organization name */ - executionsMbSecondsTotal: number; + organization: string; /** - * Aggregated number of function deployments per period. + * VCS (Version Control System) provider name. */ - deployments: Metric[]; + provider: string; /** - * Aggregated number of function deployments storage per period. + * Is VCS (Version Control System) repository private? */ - deploymentsStorage: Metric[]; + private: boolean; /** - * Aggregated number of function builds per period. + * VCS (Version Control System) repository's default branch name. */ - builds: Metric[]; + defaultBranch: string; /** - * Aggregated sum of function builds storage per period. + * VCS (Version Control System) installation ID. */ - buildsStorage: Metric[]; + providerInstallationId: string; /** - * Aggregated sum of function builds compute time per period. + * Is VCS (Version Control System) repository authorized for the installation? */ - buildsTime: Metric[]; + authorized: boolean; /** - * Aggregated number of function builds mbSeconds per period. + * Last commit date in ISO 8601 format. */ - buildsMbSeconds: Metric[]; + pushedAt: string; /** - * Aggregated number of function executions per period. + * Environment variables found in .env files */ - executions: Metric[]; + variables: string[]; /** - * Aggregated number of function executions compute time per period. + * Auto-detected framework. Empty if type is not "framework". */ - executionsTime: Metric[]; - /** - * Aggregated number of function mbSeconds per period. + framework: string; + } + + /** + * DetectionFramework + */ + export type DetectionFramework = { + /** + * Environment variables found in .env files */ - executionsMbSeconds: Metric[]; + variables?: DetectionVariable[]; /** - * Aggregated number of successful builds per period. + * Framework */ - buildsSuccess: Metric[]; + framework: string; /** - * Aggregated number of failed builds per period. + * Site Install Command */ - buildsFailed: Metric[]; + installCommand: string; + /** + * Site Build Command + */ + buildCommand: string; + /** + * Site Output Directory + */ + outputDirectory: string; } /** - * Variables List + * DetectionVariable */ - export type VariableList = { + export type DetectionVariable = { /** - * Total number of variables that matched your query. + * Name of environment variable */ - total: number; + name: string; /** - * List of variables. + * Value of environment variable */ - variables: Variable[]; + value: string; } /** - * Variable + * VcsContents */ - export type Variable = { + export type VcsContent = { /** - * Variable ID. + * Content size in bytes. Only files have size, and for directories, 0 is returned. */ - $id: string; + size?: number; /** - * Variable creation date in ISO 8601 format. + * If a content is a directory. Directories can be used to check nested contents. */ - $createdAt: string; + isDirectory?: boolean; /** - * Variable creation date in ISO 8601 format. + * Name of directory or file. */ - $updatedAt: string; + name: string; + } + + /** + * Branch + */ + export type Branch = { /** - * Variable key. + * Branch Name. + */ + name: string; + } + + /** + * Runtime + */ + export type Runtime = { + /** + * Runtime ID. + */ + $id: string; + /** + * Parent runtime key. */ key: string; /** - * Variable value. + * Runtime Name. */ - value: string; + name: string; /** - * Variable secret flag. Secret variables can only be updated or deleted, but never read. + * Runtime version. */ - secret: boolean; + version: string; /** - * Service to which the variable belongs. Possible values are "project", "function" + * Base Docker image used to build the runtime. */ - resourceType: string; + base: string; /** - * ID of resource to which the variable belongs. If resourceType is "project", it is empty. If resourceType is "function", it is ID of the function. + * Image name of Docker Hub. */ - resourceId: string; + image: string; + /** + * Name of the logo image. + */ + logo: string; + /** + * List of supported architectures. + */ + supports: string[]; } /** - * Health Status + * Framework */ - export type HealthStatus = { + export type Framework = { /** - * Name of the service. + * Framework key. + */ + key: string; + /** + * Framework Name. */ name: string; /** - * Duration in milliseconds how long the health check took. + * Default runtime version. */ - ping: number; + buildRuntime: string; /** - * Service status. Possible values are: `pass`, `fail` + * List of supported runtime versions. */ - status: HealthCheckStatus; + runtimes: string[]; + /** + * List of supported adapters. + */ + adapters: FrameworkAdapter[]; } /** - * Health Antivirus + * Framework Adapter */ - export type HealthAntivirus = { + export type FrameworkAdapter = { /** - * Antivirus version. + * Adapter key. */ - version: string; + key: string; /** - * Antivirus status. Possible values are: `disabled`, `offline`, `online` + * Default command to download dependencies. */ - status: HealthAntivirusStatus; - } - - /** - * Status List - */ - export type HealthStatusList = { + installCommand: string; /** - * Total number of statuses that matched your query. + * Default command to build site into output directory. */ - total: number; + buildCommand: string; /** - * List of statuses. + * Default output directory of build. */ - statuses: HealthStatus[]; + outputDirectory: string; + /** + * Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. + */ + fallbackFile: string; } /** - * Health Certificate + * Deployment */ - export type HealthCertificate = { + export type Deployment = { /** - * Certificate name + * Deployment ID. */ - name: string; + $id: string; /** - * Subject SN + * Deployment creation date in ISO 8601 format. */ - subjectSN: string; + $createdAt: string; /** - * Issuer organisation + * Deployment update date in ISO 8601 format. */ - issuerOrganisation: string; + $updatedAt: string; /** - * Valid from + * Type of deployment. */ - validFrom: string; + type: string; /** - * Valid to + * Resource ID. */ - validTo: string; + resourceId: string; /** - * Signature type SN + * Resource type. */ - signatureTypeSN: string; - } - - /** - * Health Queue - */ - export type HealthQueue = { + resourceType: string; /** - * Amount of actions in the queue. + * The entrypoint file to use to execute the deployment code. */ - size: number; - } - - /** - * Health Time - */ - export type HealthTime = { + entrypoint: string; /** - * Current unix timestamp on trustful remote server. + * The code size in bytes. */ - remoteTime: number; + sourceSize: number; /** - * Current unix timestamp of local server where Appwrite runs. + * The build output size in bytes. */ - localTime: number; + buildSize: number; /** - * Difference of unix remote and local timestamps in milliseconds. + * The total size in bytes (source and build output). */ - diff: number; - } - - /** - * Locale - */ - export type Locale = { + totalSize: number; /** - * User IP address. + * The current build ID. */ - ip: string; + buildId: string; /** - * Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format + * Whether the deployment should be automatically activated. */ - countryCode: string; + activate: boolean; /** - * Country name. This field support localization. + * Screenshot with light theme preference file ID. */ - country: string; + screenshotLight: string; /** - * Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America. + * Screenshot with dark theme preference file ID. */ - continentCode: string; + screenshotDark: string; /** - * Continent name. This field support localization. + * The deployment status. Possible values are "waiting", "processing", "building", "ready", "canceled" and "failed". */ - continent: string; + status: DeploymentStatus; /** - * True if country is part of the European Union. + * The build logs. */ - eu: boolean; + buildLogs: string; /** - * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format + * The current build time in seconds. */ - currency: string; - } - - /** - * Locale codes list - */ - export type LocaleCodeList = { + buildDuration: number; /** - * Total number of localeCodes that matched your query. + * The name of the vcs provider repository */ - total: number; + providerRepositoryName: string; /** - * List of localeCodes. + * The name of the vcs provider repository owner */ - localeCodes: LocaleCode[]; - } - - /** - * Continents List - */ - export type ContinentList = { + providerRepositoryOwner: string; /** - * Total number of continents that matched your query. + * The url of the vcs provider repository */ - total: number; + providerRepositoryUrl: string; /** - * List of continents. + * The commit hash of the vcs commit */ - continents: Continent[]; - } - - /** - * Countries List - */ - export type CountryList = { + providerCommitHash: string; /** - * Total number of countries that matched your query. + * The url of vcs commit author */ - total: number; + providerCommitAuthorUrl: string; /** - * List of countries. + * The name of vcs commit author */ - countries: Country[]; - } - - /** - * Phones List - */ - export type PhoneList = { + providerCommitAuthor: string; /** - * Total number of phones that matched your query. + * The commit message */ - total: number; + providerCommitMessage: string; /** - * List of phones. + * The url of the vcs commit */ - phones: Phone[]; - } - - /** - * Currencies List - */ - export type CurrencyList = { + providerCommitUrl: string; /** - * Total number of currencies that matched your query. + * The branch of the vcs repository */ - total: number; + providerBranch: string; /** - * List of currencies. + * The branch of the vcs repository */ - currencies: Currency[]; + providerBranchUrl: string; } /** - * Languages List + * Execution */ - export type LanguageList = { + export type Execution = { /** - * Total number of languages that matched your query. + * Execution ID. */ - total: number; + $id: string; /** - * List of languages. + * Execution creation date in ISO 8601 format. */ - languages: Language[]; + $createdAt: string; + /** + * Execution update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Execution roles. + */ + $permissions: string[]; + /** + * Function ID. + */ + functionId: string; + /** + * Function's deployment ID used to create the execution. + */ + deploymentId: string; + /** + * The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`. + */ + trigger: ExecutionTrigger; + /** + * The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, `failed`, or `scheduled`. + */ + status: ExecutionStatus; + /** + * HTTP request method type. + */ + requestMethod: string; + /** + * HTTP request path and query. + */ + requestPath: string; + /** + * HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. + */ + requestHeaders: Headers[]; + /** + * HTTP response status code. + */ + responseStatusCode: number; + /** + * HTTP response body. This will return empty unless execution is created as synchronous. + */ + responseBody: string; + /** + * HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. + */ + responseHeaders: Headers[]; + /** + * Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. + */ + logs: string; + /** + * Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. + */ + errors: string; + /** + * Resource(function/site) execution duration in seconds. + */ + duration: number; + /** + * The scheduled time for execution. If left empty, execution will be queued immediately. + */ + scheduledAt?: string; } /** - * Message list + * Project */ - export type MessageList = { + export type Project = { + /** + * Project ID. + */ + $id: string; + /** + * Project creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Project update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * 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; /** - * Total number of messages that matched your query. + * Session duration in seconds. */ - total: number; + authDuration: number; /** - * List of messages. + * Max users allowed. 0 is unlimited. */ - messages: Message[]; - } - - /** - * Message - */ - export type Message = { + authLimit: number; /** - * Message ID. + * Max sessions allowed per user. 100 maximum. */ - $id: string; + authSessionsLimit: number; /** - * Message creation time in ISO 8601 format. + * Max allowed passwords in the history list per user. Max passwords limit allowed in history is 20. Use 0 for disabling password history. */ - $createdAt: string; + authPasswordHistory: number; /** - * Message update date in ISO 8601 format. + * Whether or not to check user's password against most commonly used passwords. */ - $updatedAt: string; + authPasswordDictionary: boolean; /** - * Message provider type. + * Whether or not to check the user password for similarity with their personal data. */ - providerType: string; + authPersonalDataCheck: boolean; /** - * Topic IDs set as recipients. + * An array of mock numbers and their corresponding verification codes (OTPs). */ - topics: string[]; + authMockNumbers: MockNumber[]; /** - * User IDs set as recipients. + * Whether or not to send session alert emails to users. */ - users: string[]; + authSessionAlerts: boolean; /** - * Target IDs set as recipients. + * Whether or not to show user names in the teams membership response. */ - targets: string[]; + authMembershipsUserName: boolean; /** - * The scheduled time for message. + * Whether or not to show user emails in the teams membership response. */ - scheduledAt?: string; + authMembershipsUserEmail: boolean; /** - * The time when the message was delivered. + * Whether or not to show user MFA status in the teams membership response. */ - deliveredAt?: string; + authMembershipsMfa: boolean; /** - * Delivery errors if any. + * Whether or not all existing sessions should be invalidated on password change */ - deliveryErrors?: string[]; + authInvalidateSessions: boolean; /** - * Number of recipients the message was delivered to. + * List of Auth Providers. */ - deliveredTotal: number; + oAuthProviders: AuthProvider[]; /** - * Data of the message. + * List of Platforms. */ - data: object; + platforms: Platform[]; /** - * Status of delivery. + * List of Webhooks. */ - status: MessageStatus; - } - - /** - * Target list - */ - export type TargetList = { + webhooks: Webhook[]; /** - * Total number of targets that matched your query. + * List of API Keys. */ - total: number; + keys: Key[]; /** - * List of targets. + * List of dev keys. */ - targets: Target[]; - } - - /** - * Provider list - */ - export type ProviderList = { + devKeys: DevKey[]; /** - * Total number of providers that matched your query. + * Status for custom SMTP */ - total: number; + smtpEnabled: boolean; /** - * List of providers. + * SMTP sender name */ - providers: Provider[]; - } - - /** - * Provider - */ - export type Provider = { + smtpSenderName: string; /** - * Provider ID. + * SMTP sender email */ - $id: string; + smtpSenderEmail: string; /** - * Provider creation time in ISO 8601 format. + * SMTP reply to email */ - $createdAt: string; + smtpReplyTo: string; /** - * Provider update date in ISO 8601 format. + * SMTP server host name */ - $updatedAt: string; + smtpHost: string; /** - * The name for the provider instance. + * SMTP server port */ - name: string; + smtpPort: number; /** - * The name of the provider service. + * SMTP server username */ - provider: string; + smtpUsername: string; /** - * Is provider enabled? + * SMTP server password */ - enabled: boolean; + smtpPassword: string; /** - * Type of provider. + * SMTP server secure protocol */ - type: string; + smtpSecure: string; /** - * Provider credentials. + * Number of times the ping was received for this project. */ - credentials: object; + pingCount: number; /** - * Provider options. + * Last ping datetime in ISO 8601 format. */ - options?: object; - } - - /** - * Topic list - */ - export type TopicList = { + pingedAt: string; /** - * Total number of topics that matched your query. + * Labels for the project. */ - total: number; + labels: string[]; /** - * List of topics. + * Project status */ - topics: Topic[]; - } - - /** - * Topic - */ - export type Topic = { + status: string; /** - * Topic ID. + * Email/Password auth method status */ - $id: string; + authEmailPassword: boolean; /** - * Topic creation time in ISO 8601 format. + * Magic URL auth method status */ - $createdAt: string; + authUsersAuthMagicURL: boolean; /** - * Topic update date in ISO 8601 format. + * Email (OTP) auth method status */ - $updatedAt: string; + authEmailOtp: boolean; /** - * The name of the topic. + * Anonymous auth method status */ - name: string; + authAnonymous: boolean; /** - * Total count of email subscribers subscribed to the topic. + * Invites auth method status */ - emailTotal: number; + authInvites: boolean; /** - * Total count of SMS subscribers subscribed to the topic. + * JWT auth method status */ - smsTotal: number; + authJWT: boolean; /** - * Total count of push subscribers subscribed to the topic. + * Phone auth method status */ - pushTotal: number; + authPhone: boolean; /** - * Subscribe permissions. + * Account service status */ - subscribe: string[]; - } - - /** - * Subscriber list - */ - export type SubscriberList = { + serviceStatusForAccount: boolean; /** - * Total number of subscribers that matched your query. + * Avatars service status */ - total: number; + serviceStatusForAvatars: boolean; /** - * List of subscribers. + * Databases (legacy) service status */ - subscribers: Subscriber[]; - } - - /** - * Subscriber - */ - export type Subscriber = { + serviceStatusForDatabases: boolean; /** - * Subscriber ID. + * TablesDB service status */ - $id: string; + serviceStatusForTablesdb: boolean; /** - * Subscriber creation time in ISO 8601 format. + * Locale service status */ - $createdAt: string; + serviceStatusForLocale: boolean; /** - * Subscriber update date in ISO 8601 format. + * Health service status */ - $updatedAt: string; + serviceStatusForHealth: boolean; /** - * Target ID. + * Storage service status */ - targetId: string; + serviceStatusForStorage: boolean; /** - * Target. + * Teams service status */ - target: Target; + serviceStatusForTeams: boolean; /** - * Topic ID. + * Users service status */ - userId: string; + serviceStatusForUsers: boolean; /** - * User Name. + * Sites service status */ - userName: string; + serviceStatusForSites: boolean; /** - * Topic ID. + * Functions service status */ - topicId: string; + serviceStatusForFunctions: boolean; /** - * The target provider type. Can be one of the following: `email`, `sms` or `push`. + * GraphQL service status */ - providerType: string; - } - - /** - * Migrations List - */ - export type MigrationList = { + serviceStatusForGraphql: boolean; + /** + * Messaging service status + */ + serviceStatusForMessaging: boolean; + /** + * Project region + */ + region: string; /** - * Total number of migrations that matched your query. + * Billing limits reached */ - total: number; + billingLimits: BillingLimits; /** - * List of migrations. + * Project blocks information */ - migrations: Migration[]; + blocks: Block[]; + /** + * Last time the project was accessed via console. Used with plan's projectInactivityDays to determine if project is paused. + */ + consoleAccessedAt: string; } /** - * Migration + * Webhook */ - export type Migration = { + export type Webhook = { /** - * Migration ID. + * Webhook ID. */ $id: string; /** - * Migration creation date in ISO 8601 format. + * Webhook creation date in ISO 8601 format. */ $createdAt: string; /** - * Variable creation date in ISO 8601 format. + * Webhook update date in ISO 8601 format. */ $updatedAt: string; /** - * Migration status ( pending, processing, failed, completed ) + * Webhook name. */ - status: string; + name: string; /** - * Migration stage ( init, processing, source-check, destination-check, migrating, finished ) + * Webhook URL endpoint. */ - stage: string; + url: string; /** - * A string containing the type of source of the migration. + * Webhook trigger events. */ - source: string; + events: string[]; /** - * A string containing the type of destination of the migration. + * Indicated if SSL / TLS Certificate verification is enabled. */ - destination: string; + security: boolean; /** - * Resources to migrate. + * HTTP basic authentication username. */ - resources: string[]; + httpUser: string; /** - * Id of the resource to migrate. + * HTTP basic authentication password. */ - resourceId: string; + httpPass: string; /** - * A group of counters that represent the total progress of the migration. + * Signature key which can be used to validated incoming */ - statusCounters: object; + signatureKey: string; /** - * An array of objects containing the report data of the resources that were migrated. + * Indicates if this webhook is enabled. */ - resourceData: object; + enabled: boolean; /** - * All errors that occurred during the migration process. + * Webhook error logs from the most recent failure. */ - errors: string[]; + logs: string; /** - * Migration options used during the migration process. + * Number of consecutive failed webhook attempts. */ - options: object; + attempts: number; } /** - * Migration Report + * Key */ - export type MigrationReport = { + export type Key = { /** - * Number of users to be migrated. + * Key ID. */ - user: number; + $id: string; /** - * Number of teams to be migrated. + * Key creation date in ISO 8601 format. */ - team: number; + $createdAt: string; /** - * Number of databases to be migrated. + * Key update date in ISO 8601 format. */ - database: number; + $updatedAt: string; /** - * Number of rows to be migrated. + * Key name. */ - row: number; + name: string; /** - * Number of files to be migrated. + * Key expiration date in ISO 8601 format. */ - file: number; + expire: string; /** - * Number of buckets to be migrated. + * Allowed permission scopes. */ - bucket: number; + scopes: string[]; /** - * Number of functions to be migrated. + * Secret key. */ - function: number; + secret: string; /** - * Number of sites to be migrated. + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. */ - site: number; + accessedAt: string; /** - * Number of providers to be migrated. + * List of SDK user agents that used this key. */ - provider: number; + sdks: string[]; + } + + /** + * DevKey + */ + export type DevKey = { /** - * Number of topics to be migrated. + * Key ID. */ - topic: number; + $id: string; /** - * Number of subscribers to be migrated. + * Key creation date in ISO 8601 format. */ - subscriber: number; + $createdAt: string; /** - * Number of messages to be migrated. + * Key update date in ISO 8601 format. */ - message: number; + $updatedAt: string; /** - * Size of files to be migrated in mb. + * Key name. */ - size: number; + name: string; /** - * Version of the Appwrite instance to be migrated. + * Key expiration date in ISO 8601 format. */ - version: string; - } - - /** - * Organizations list - */ - export type OrganizationList = { + expire: string; /** - * Total number of teams that matched your query. + * Secret key. */ - total: number; + secret: string; /** - * List of teams. + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. */ - teams: Organization[]; + accessedAt: string; + /** + * List of SDK user agents that used this key. + */ + sdks: string[]; } /** - * PaymentAuthentication + * Mock Number */ - 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 MockNumber = { /** - * Organization ID for which the payment authentication is needed. + * Mock phone number for testing phone authentication. Useful for testing phone authentication without sending an SMS. */ - organizationId: string; + phone: string; /** - * Invoice ID against which the payment needs to be validated. + * Mock OTP for the number. */ - invoiceId: string; + otp: string; } /** - * Estimation + * AuthProvider */ - export type Estimation = { - /** - * Total amount - */ - amount: number; - /** - * Gross payable amount - */ - grossAmount: number; - /** - * Discount amount - */ - discount: number; + export type AuthProvider = { /** - * Credits amount + * Auth Provider. */ - credits: number; + key: string; /** - * Estimation items + * Auth Provider name. */ - items: EstimationItem[]; + name: string; /** - * Estimation discount items + * OAuth 2.0 application ID. */ - discounts: EstimationItem[]; + appId: string; /** - * Trial days + * OAuth 2.0 application secret. Might be JSON string if provider requires extra configuration. */ - trialDays: number; + secret: string; /** - * Trial end date + * Auth Provider is active and can be used to create session. */ - trialEndDate?: string; + enabled: boolean; } /** - * Aggregation team list + * Platform */ - export type AggregationTeamList = { + export type Platform = { /** - * Total number of aggregations that matched your query. + * Platform ID. */ - total: number; + $id: string; /** - * List of aggregations. + * Platform creation date in ISO 8601 format. */ - aggregations: AggregationTeam[]; - } - - /** - * AggregationTeam - */ - export type AggregationTeam = { + $createdAt: string; /** - * Aggregation ID. + * Platform update date in ISO 8601 format. */ - $id: string; + $updatedAt: string; /** - * Aggregation creation time in ISO 8601 format. + * Platform name. */ - $createdAt: string; + name: string; /** - * Aggregation update date in ISO 8601 format. + * Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android. */ - $updatedAt: string; + type: PlatformType; /** - * Aggregation permissions. [Learn more about permissions](/docs/permissions). + * Platform Key. iOS bundle ID or Android package name. Empty string for other platforms. */ - $permissions: string[]; + key: string; /** - * Beginning date of the invoice + * App store or Google Play store ID. */ - from: string; + store: string; /** - * End date of the invoice + * Web app hostname. Empty string for other platforms. */ - to: string; + hostname: string; /** - * Total storage usage + * HTTP basic authentication username. */ - usageStorage: number; + httpUser: string; + /** + * HTTP basic authentication password. + */ + httpPass: string; + } + + /** + * Variable + */ + export type Variable = { /** - * Total storage usage with builds storage + * Variable ID. */ - usageTotalStorage: number; + $id: string; /** - * Total files storage usage + * Variable creation date in ISO 8601 format. */ - usageFilesStorage: number; + $createdAt: string; /** - * Total deployments storage usage + * Variable creation date in ISO 8601 format. */ - usageDeploymentsStorage: number; + $updatedAt: string; /** - * Total builds storage usage + * Variable key. */ - usageBuildsStorage: number; + key: string; /** - * Total databases storage usage + * Variable value. */ - usageDatabasesStorage: number; + value: string; /** - * Total active users for the billing period + * Variable secret flag. Secret variables can only be updated or deleted, but never read. */ - usageUsers: number; + secret: boolean; /** - * Total number of executions for the billing period + * Service to which the variable belongs. Possible values are "project", "function" */ - usageExecutions: number; + resourceType: string; /** - * Total bandwidth usage for the billing period + * ID of resource to which the variable belongs. If resourceType is "project", it is empty. If resourceType is "function", it is ID of the function. */ - usageBandwidth: number; + resourceId: string; + } + + /** + * Country + */ + export type Country = { /** - * Peak concurrent realtime connections for the billing period + * Country name. */ - usageRealtime: number; + name: string; /** - * Total realtime messages sent for the billing period + * Country two-character ISO 3166-1 alpha code. */ - usageRealtimeMessages: number; + code: string; + } + + /** + * Continent + */ + export type Continent = { /** - * Total realtime bandwidth usage for the billing period + * Continent name. */ - usageRealtimeBandwidth: number; + name: string; /** - * Additional members + * Continent two letter code. */ - additionalMembers: number; + code: string; + } + + /** + * Language + */ + export type Language = { /** - * Additional members cost + * Language name. */ - additionalMemberAmount: number; + name: string; /** - * Additional storage usage cost + * Language two-character ISO 639-1 codes. */ - additionalStorageAmount: number; + code: string; /** - * Additional users usage cost. + * Language native name. */ - additionalUsersAmount: number; + nativeName: string; + } + + /** + * Currency + */ + export type Currency = { /** - * Additional executions usage cost + * Currency symbol. */ - additionalExecutionsAmount: number; + symbol: string; /** - * Additional bandwidth usage cost + * Currency name. */ - additionalBandwidthAmount: number; + name: string; /** - * Additional realtime usage cost + * Currency native symbol. */ - additionalRealtimeAmount: number; + symbolNative: string; /** - * Billing plan + * Number of decimal digits. */ - plan: string; + decimalDigits: number; /** - * Aggregated amount + * Currency digit rounding. */ - amount: number; + rounding: number; /** - * Aggregation project breakdown + * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format. */ - breakdown: AggregationBreakdown[]; + code: string; /** - * Usage resources + * Currency plural name */ - resources: UsageResources[]; + namePlural: string; } /** - * CreditList + * Phone */ - export type CreditList = { + export type Phone = { /** - * Credits + * Phone code. */ - credits: Credit[]; + code: string; /** - * Total number of credits + * Country two-character ISO 3166-1 alpha code. */ - total: number; + countryCode: string; /** - * Total available credit balance in USD + * Country name. */ - available: number; + countryName: string; } /** - * Credit + * Health Antivirus */ - export type Credit = { - /** - * Credit ID. - */ - $id: string; + export type HealthAntivirus = { /** - * Credit creation time in ISO 8601 format. + * Antivirus version. */ - $createdAt: string; + version: string; /** - * Credit update date in ISO 8601 format. + * Antivirus status. Possible values are: `disabled`, `offline`, `online` */ - $updatedAt: string; + status: HealthAntivirusStatus; + } + + /** + * Health Queue + */ + export type HealthQueue = { /** - * Credit permissions. [Learn more about permissions](/docs/permissions). + * Amount of actions in the queue. */ - $permissions: string[]; + size: number; + } + + /** + * Health Status + */ + export type HealthStatus = { /** - * coupon ID + * Name of the service. */ - couponId: string; + name: string; /** - * ID of the User. + * Duration in milliseconds how long the health check took. */ - userId: string; + ping: number; /** - * ID of the Team. + * Service status. Possible values are: `pass`, `fail` */ - teamId: string; + status: HealthCheckStatus; + } + + /** + * Health Certificate + */ + export type HealthCertificate = { /** - * Provided credit amount + * Certificate name */ - credits: number; + name: string; /** - * Provided credit amount + * Subject SN */ - total: number; + subjectSN: string; /** - * Credit expiration time in ISO 8601 format. + * Issuer organisation */ - expiration: string; + issuerOrganisation: string; /** - * Status of the credit. Can be one of `disabled`, `active` or `expired`. + * Valid from */ - status: string; - } - - /** - * CreditAvailable - */ - export type CreditAvailable = { + validFrom: string; /** - * Total available credits for the organization. + * Valid to */ - available: number; - } - - /** - * EstimationDeleteOrganization - */ - export type EstimationDeleteOrganization = { + validTo: string; /** - * List of unpaid invoices + * Signature type SN */ - unpaidInvoices: Invoice[]; + signatureTypeSN: string; } /** - * EstimationUpdatePlan + * Health Time */ - export type EstimationUpdatePlan = { + export type HealthTime = { /** - * Total amount + * Current unix timestamp on trustful remote server. */ - amount: number; + remoteTime: number; /** - * Gross payable amount + * Current unix timestamp of local server where Appwrite runs. */ - grossAmount: number; + localTime: number; /** - * Discount amount + * Difference of unix remote and local timestamps in milliseconds. */ - discount: number; + diff: number; + } + + /** + * Metric + */ + export type Metric = { /** - * Credits amount + * The value of this metric at the timestamp. */ - credits: number; + value: number; /** - * Estimation items + * The date at which this metric was aggregated in ISO 8601 format. */ - items: EstimationItem[]; + date: string; + } + + /** + * Metric Breakdown + */ + export type MetricBreakdown = { /** - * Estimation discount items + * Resource ID. */ - discounts: EstimationItem[]; + resourceId?: string; /** - * Trial days + * Resource name. */ - trialDays: number; + name: string; /** - * Trial end date + * The value of this metric at the timestamp. */ - trialEndDate?: string; + value: number; /** - * Organization's existing credits + * The estimated value of this metric at the end of the period. */ - organizationCredits: number; + estimate?: number; } /** - * Downgrade Feedback + * UsageDatabases */ - export type DowngradeFeedback = { + export type UsageDatabases = { /** - * Feedback ID. + * Time range of the usage stats. */ - $id: string; + range: string; /** - * Feedback creation date in ISO 8601 format. + * Total aggregated number of databases. */ - $createdAt: string; + databasesTotal: number; /** - * Feedback update date in ISO 8601 format. + * Total aggregated number of collections. */ - $updatedAt: string; + collectionsTotal: number; /** - * Feedback reason + * Total aggregated number of tables. */ - title: string; + tablesTotal: number; /** - * Feedback message + * Total aggregated number of documents. */ - message: string; + documentsTotal: number; /** - * Plan ID downgrading from + * Total aggregated number of rows. */ - fromPlanId: string; + rowsTotal: number; /** - * Plan ID downgrading to + * Total aggregated number of total databases storage in bytes. */ - toPlanId: string; + storageTotal: number; /** - * Organization ID + * Total number of databases reads. */ - teamId: string; + databasesReadsTotal: number; /** - * User ID who submitted feedback + * Total number of databases writes. */ - userId: string; + databasesWritesTotal: number; /** - * Console version + * Aggregated number of databases per period. */ - version: string; - } - - /** - * Invoice - */ - export type Invoice = { + databases: Metric[]; /** - * Invoice ID. + * Aggregated number of collections per period. */ - $id: string; + collections: Metric[]; /** - * Invoice creation time in ISO 8601 format. + * Aggregated number of tables per period. */ - $createdAt: string; + tables: Metric[]; /** - * Invoice update date in ISO 8601 format. + * Aggregated number of documents per period. */ - $updatedAt: string; + documents: Metric[]; /** - * Invoice permissions. [Learn more about permissions](/docs/permissions). + * Aggregated number of rows per period. */ - $permissions: string[]; + rows: Metric[]; /** - * Project ID + * An array of the aggregated number of databases storage in bytes per period. */ - teamId: string; + storage: Metric[]; /** - * Aggregation ID + * An array of aggregated number of database reads. */ - aggregationId: string; + databasesReads: Metric[]; /** - * Billing plan selected. Can be one of `tier-0`, `tier-1` or `tier-2`. + * An array of aggregated number of database writes. */ - plan: string; + databasesWrites: Metric[]; + } + + /** + * UsageDatabase + */ + export type UsageDatabase = { /** - * Usage breakdown per resource + * Time range of the usage stats. */ - usage: UsageResources[]; + range: string; /** - * Invoice Amount + * Total aggregated number of collections. */ - amount: number; + collectionsTotal: number; /** - * Tax percentage + * Total aggregated number of tables. */ - tax: number; + tablesTotal: number; /** - * Tax amount + * Total aggregated number of documents. */ - taxAmount: number; + documentsTotal: number; /** - * VAT percentage + * Total aggregated number of rows. */ - vat: number; + rowsTotal: number; /** - * VAT amount + * Total aggregated number of total storage used in bytes. */ - vatAmount: number; + storageTotal: number; /** - * Gross amount after vat, tax, and discounts applied. + * Total number of databases reads. */ - grossAmount: number; + databaseReadsTotal: number; /** - * Credits used. + * Total number of databases writes. */ - creditsUsed: number; + databaseWritesTotal: number; /** - * Currency the invoice is in + * Aggregated number of collections per period. */ - currency: string; + collections: Metric[]; /** - * Client secret for processing failed payments in front-end + * Aggregated number of tables per period. */ - clientSecret: string; + tables: Metric[]; /** - * Invoice status + * Aggregated number of documents per period. */ - status: string; + documents: Metric[]; /** - * Last payment error associated with the invoice + * Aggregated number of rows per period. */ - lastError: string; + rows: Metric[]; /** - * Invoice due date. + * Aggregated storage used in bytes per period. */ - dueAt: string; + storage: Metric[]; /** - * Beginning date of the invoice + * An array of aggregated number of database reads. */ - from: string; + databaseReads: Metric[]; /** - * End date of the invoice + * An array of aggregated number of database writes. */ - to: string; + databaseWrites: Metric[]; } /** - * Roles + * UsageTable */ - export type Roles = { + export type UsageTable = { /** - * Array of scopes accessible to current user. + * Time range of the usage stats. */ - scopes: string[]; + range: string; /** - * Array of roles assigned to current user. + * Total aggregated number of of rows. */ - roles: string[]; + rowsTotal: number; + /** + * Aggregated number of rows per period. + */ + rows: Metric[]; } /** - * UsageOrganization + * UsageCollection */ - export type UsageOrganization = { - /** - * Aggregated stats for number of requests. - */ - bandwidth: Metric[]; - /** - * Aggregated stats for consumed bandwidth. - */ - users: Metric[]; - /** - * Aggregated stats for function executions. - */ - executions: Metric[]; - /** - * Aggregated stats for database reads. - */ - databasesReads: Metric[]; + export type UsageCollection = { /** - * Aggregated stats for database writes. + * Time range of the usage stats. */ - databasesWrites: Metric[]; + range: string; /** - * Aggregated stats for file transformations. + * Total aggregated number of of documents. */ - imageTransformations: Metric[]; + documentsTotal: number; /** - * Aggregated stats for total file transformations. + * Aggregated number of documents per period. */ - imageTransformationsTotal: number; + documents: Metric[]; + } + + /** + * UsageUsers + */ + export type UsageUsers = { /** - * Aggregated stats for file transformations. + * Time range of the usage stats. */ - screenshotsGenerated: Metric[]; + range: string; /** - * Aggregated stats for total file transformations. + * Total aggregated number of statistics of users. */ - screenshotsGeneratedTotal: number; + usersTotal: number; /** - * Aggregated stats for imagine credits. + * Total aggregated number of active sessions. */ - imagineCredits: Metric[]; + sessionsTotal: number; /** - * Aggregated stats for total imagine credits. + * Aggregated number of users per period. */ - imagineCreditsTotal: number; + users: Metric[]; /** - * Aggregated stats for total users. + * Aggregated number of active sessions per period. */ - usersTotal: number; + sessions: Metric[]; + } + + /** + * StorageUsage + */ + export type UsageStorage = { /** - * Aggregated stats for total executions. + * Time range of the usage stats. */ - executionsTotal: number; + range: string; /** - * Aggregated stats for function executions in mb seconds. + * Total aggregated number of buckets */ - executionsMBSecondsTotal: number; + bucketsTotal: number; /** - * Aggregated stats for function builds in mb seconds. + * Total aggregated number of files. */ - buildsMBSecondsTotal: number; + filesTotal: number; /** - * Aggregated stats for total file storage. + * Total aggregated number of files storage (in bytes). */ filesStorageTotal: number; /** - * Aggregated stats for total builds storage. + * Aggregated number of buckets per period. */ - buildsStorageTotal: number; + buckets: Metric[]; /** - * Aggregated stats for total deployments storage. + * Aggregated number of files per period. */ - deploymentsStorageTotal: number; + files: Metric[]; /** - * Aggregated stats for total databases storage. + * Aggregated number of files storage (in bytes) per period . */ - databasesStorageTotal: number; + storage: Metric[]; + } + + /** + * UsageBuckets + */ + export type UsageBuckets = { /** - * Aggregated stats for total databases reads. + * Time range of the usage stats. */ - databasesReadsTotal: number; + range: string; /** - * Aggregated stats for total databases writes. + * Total aggregated number of bucket files. */ - databasesWritesTotal: number; + filesTotal: number; /** - * Aggregated stats for total backups storage. + * Total aggregated number of bucket files storage (in bytes). */ - backupsStorageTotal: number; + filesStorageTotal: number; /** - * Aggregated stats for total storage. + * Aggregated number of bucket files per period. */ - storageTotal: number; + files: Metric[]; /** - * Aggregated stats for total auth phone. + * Aggregated number of bucket storage files (in bytes) per period. */ - authPhoneTotal: number; + storage: Metric[]; /** - * Aggregated stats for total auth phone estimation. + * Aggregated number of files transformations per period. */ - authPhoneEstimate: number; + imageTransformations: Metric[]; /** - * Aggregated stats for each projects. + * Total aggregated number of files transformations. */ - projects: UsageOrganizationProject[]; + imageTransformationsTotal: number; } /** - * UsageProject + * UsageFunctions */ - export type UsageProject = { + export type UsageFunctions = { /** - * Total aggregated number of function executions. + * Time range of the usage stats. */ - executionsTotal: number; + range: string; /** - * Total aggregated number of documents in legacy/tablesdb. + * Total aggregated number of functions. */ - documentsTotal: number; + functionsTotal: number; /** - * Total aggregated number of documents in documentsdb. + * Total aggregated number of functions deployments. */ - documentsdbDocumentsTotal: number; + deploymentsTotal: number; /** - * Total aggregated number of rows. + * Total aggregated sum of functions deployment storage. */ - rowsTotal: number; + deploymentsStorageTotal: number; /** - * Total aggregated number of databases. + * Total aggregated number of functions build. */ - databasesTotal: number; + buildsTotal: number; /** - * Total aggregated number of documentsdb. + * total aggregated sum of functions build storage. */ - documentsdbTotal: number; + buildsStorageTotal: number; /** - * Total aggregated sum of databases storage size (in bytes). + * Total aggregated sum of functions build compute time. */ - databasesStorageTotal: number; + buildsTimeTotal: number; /** - * Total aggregated sum of documentsdb databases storage size (in bytes). + * Total aggregated sum of functions build mbSeconds. */ - documentsdbDatabasesStorageTotal: number; + buildsMbSecondsTotal: number; /** - * Total aggregated number of users. + * Total aggregated number of functions execution. */ - usersTotal: number; + executionsTotal: number; /** - * Total aggregated sum of files storage size (in bytes). + * Total aggregated sum of functions execution compute time. */ - filesStorageTotal: number; + executionsTimeTotal: number; /** - * Total aggregated sum of functions storage size (in bytes). + * Total aggregated sum of functions execution mbSeconds. */ - functionsStorageTotal: number; + executionsMbSecondsTotal: number; /** - * Total aggregated sum of builds storage size (in bytes). + * Aggregated number of functions per period. */ - buildsStorageTotal: number; + functions: Metric[]; /** - * Total aggregated sum of deployments storage size (in bytes). + * Aggregated number of functions deployment per period. */ - deploymentsStorageTotal: number; + deployments: Metric[]; /** - * Total aggregated number of buckets. + * Aggregated number of functions deployment storage per period. */ - bucketsTotal: number; + deploymentsStorage: Metric[]; /** - * Total aggregated number of function executions mbSeconds. + * Total aggregated number of successful function builds. */ - executionsMbSecondsTotal: number; + buildsSuccessTotal: number; /** - * Total aggregated number of function builds mbSeconds. + * Total aggregated number of failed function builds. */ - buildsMbSecondsTotal: number; + buildsFailedTotal: number; /** - * Aggregated stats for total databases reads. + * Aggregated number of functions build per period. */ - databasesReadsTotal: number; + builds: Metric[]; /** - * Aggregated stats for total databases writes. + * Aggregated sum of functions build storage per period. */ - databasesWritesTotal: number; + buildsStorage: Metric[]; /** - * Total number of documentsdb databases reads. + * Aggregated sum of functions build compute time per period. */ - documentsdbDatabasesReadsTotal: number; + buildsTime: Metric[]; /** - * Total number of documentsdb databases writes. + * Aggregated sum of functions build mbSeconds per period. */ - documentsdbDatabasesWritesTotal: number; + buildsMbSeconds: Metric[]; /** - * Aggregated number of requests per period. + * Aggregated number of functions execution per period. */ - requests: Metric[]; + executions: Metric[]; /** - * Aggregated number of consumed bandwidth per period. + * Aggregated number of functions execution compute time per period. */ - network: Metric[]; + executionsTime: Metric[]; /** - * Aggregated number of users per period. + * Aggregated number of functions mbSeconds per period. */ - users: Metric[]; + executionsMbSeconds: Metric[]; /** - * Aggregated number of executions per period. + * Aggregated number of successful function builds per period. */ - executions: Metric[]; + buildsSuccess: Metric[]; /** - * Aggregated breakdown in totals of executions by functions. + * Aggregated number of failed function builds per period. */ - executionsBreakdown: MetricBreakdown[]; + buildsFailed: Metric[]; + } + + /** + * UsageFunction + */ + export type UsageFunction = { /** - * Aggregated breakdown in totals of usage by buckets. + * The time range of the usage stats. */ - bucketsBreakdown: MetricBreakdown[]; + range: string; /** - * An array of the aggregated breakdown of storage usage by databases. + * Total aggregated number of function deployments. */ - databasesStorageBreakdown: MetricBreakdown[]; + deploymentsTotal: number; /** - * Aggregated breakdown in totals of execution mbSeconds by functions. + * Total aggregated sum of function deployments storage. */ - executionsMbSecondsBreakdown: MetricBreakdown[]; + deploymentsStorageTotal: number; /** - * Aggregated breakdown in totals of build mbSeconds by functions. + * Total aggregated number of function builds. */ - buildsMbSecondsBreakdown: MetricBreakdown[]; + buildsTotal: number; /** - * Aggregated breakdown in totals of functions storage size (in bytes). + * Total aggregated number of successful function builds. */ - functionsStorageBreakdown: MetricBreakdown[]; + buildsSuccessTotal: number; /** - * Aggregated stats for total auth phone. + * Total aggregated number of failed function builds. */ - authPhoneTotal: number; + buildsFailedTotal: number; /** - * Aggregated stats for total auth phone estimation. + * total aggregated sum of function builds storage. */ - authPhoneEstimate: number; + buildsStorageTotal: number; /** - * Aggregated breakdown in totals of phone auth by country. + * Total aggregated sum of function builds compute time. */ - authPhoneCountryBreakdown: MetricBreakdown[]; + buildsTimeTotal: number; /** - * Aggregated stats for database reads. + * Average builds compute time. */ - databasesReads: Metric[]; + buildsTimeAverage: number; /** - * Aggregated stats for database writes. + * Total aggregated sum of function builds mbSeconds. */ - databasesWrites: Metric[]; + buildsMbSecondsTotal: number; /** - * An array of aggregated number of documentsdb database reads. + * Total aggregated number of function executions. */ - documentsdbDatabasesReads: Metric[]; + executionsTotal: number; /** - * An array of aggregated number of documentsdb database writes. + * Total aggregated sum of function executions compute time. */ - documentsdbDatabasesWrites: Metric[]; + executionsTimeTotal: number; /** - * An array of aggregated sum of documentsdb databases storage size (in bytes) per period. + * Total aggregated sum of function executions mbSeconds. */ - documentsdbDatabasesStorage: Metric[]; + executionsMbSecondsTotal: number; /** - * An array of aggregated number of image transformations. + * Aggregated number of function deployments per period. */ - imageTransformations: Metric[]; + deployments: Metric[]; /** - * Total aggregated number of image transformations. + * Aggregated number of function deployments storage per period. */ - imageTransformationsTotal: number; + deploymentsStorage: Metric[]; /** - * Total aggregated number of VectorsDB databases. + * Aggregated number of function builds per period. */ - vectorsdbDatabasesTotal: number; + builds: Metric[]; /** - * Total aggregated number of VectorsDB collections. + * Aggregated sum of function builds storage per period. */ - vectorsdbCollectionsTotal: number; + buildsStorage: Metric[]; /** - * Total aggregated number of VectorsDB documents. + * Aggregated sum of function builds compute time per period. */ - vectorsdbDocumentsTotal: number; + buildsTime: Metric[]; /** - * Total aggregated VectorsDB storage (bytes). + * Aggregated number of function builds mbSeconds per period. */ - vectorsdbDatabasesStorageTotal: number; + buildsMbSeconds: Metric[]; /** - * Total aggregated number of VectorsDB reads. + * Aggregated number of function executions per period. */ - vectorsdbDatabasesReadsTotal: number; + executions: Metric[]; /** - * Total aggregated number of VectorsDB writes. + * Aggregated number of function executions compute time per period. */ - vectorsdbDatabasesWritesTotal: number; + executionsTime: Metric[]; /** - * Aggregated VectorsDB databases per period. + * Aggregated number of function mbSeconds per period. */ - vectorsdbDatabases: Metric[]; + executionsMbSeconds: Metric[]; /** - * Aggregated VectorsDB collections per period. + * Aggregated number of successful builds per period. + */ + buildsSuccess: Metric[]; + /** + * Aggregated number of failed builds per period. + */ + buildsFailed: Metric[]; + } + + /** + * UsageSites + */ + export type UsageSites = { + /** + * Time range of the usage stats. */ - vectorsdbCollections: Metric[]; + range: string; /** - * Aggregated VectorsDB documents per period. + * Total aggregated number of sites. */ - vectorsdbDocuments: Metric[]; + sitesTotal: number; /** - * Aggregated VectorsDB storage per period. + * Aggregated number of sites per period. */ - vectorsdbDatabasesStorage: Metric[]; + sites: Metric[]; /** - * Aggregated VectorsDB reads per period. + * Total aggregated number of sites deployments. */ - vectorsdbDatabasesReads: Metric[]; + deploymentsTotal: number; /** - * Aggregated VectorsDB writes per period. + * Total aggregated sum of sites deployment storage. */ - vectorsdbDatabasesWrites: Metric[]; + deploymentsStorageTotal: number; /** - * Aggregated number of text embedding calls per period. + * Total aggregated number of sites build. */ - embeddingsText: Metric; + buildsTotal: number; /** - * Aggregated number of tokens processed by text embeddings per period. + * total aggregated sum of sites build storage. */ - embeddingsTextTokens: Metric; + buildsStorageTotal: number; /** - * Aggregated duration spent generating text embeddings per period. + * Total aggregated sum of sites build compute time. */ - embeddingsTextDuration: Metric; + buildsTimeTotal: number; /** - * Aggregated number of errors while generating text embeddings per period. + * Total aggregated sum of sites build mbSeconds. */ - embeddingsTextErrors: Metric; + buildsMbSecondsTotal: number; /** - * Total aggregated number of text embedding calls. + * Total aggregated number of sites execution. */ - embeddingsTextTotal: Metric; + executionsTotal: number; /** - * Total aggregated number of tokens processed by text. + * Total aggregated sum of sites execution compute time. */ - embeddingsTextTokensTotal: Metric; + executionsTimeTotal: number; /** - * Total aggregated duration spent generating text embeddings. + * Total aggregated sum of sites execution mbSeconds. */ - embeddingsTextDurationTotal: Metric; + executionsMbSecondsTotal: number; /** - * Total aggregated number of errors while generating text embeddings. + * Total aggregated number of requests. */ - embeddingsTextErrorsTotal: Metric; + requestsTotal: number; /** - * Aggregated number of function executions per period. + * Aggregated number of requests per period. */ - functionsExecutions: Metric[]; + requests: Metric[]; /** - * Total aggregated number of function executions. + * Total aggregated inbound bandwidth. */ - functionsExecutionsTotal: number; + inboundTotal: number; /** - * Aggregated number of site executions per period. + * Aggregated number of inbound bandwidth per period. */ - sitesExecutions: Metric[]; + inbound: Metric[]; /** - * Total aggregated number of site executions. + * Total aggregated outbound bandwidth. */ - sitesExecutionsTotal: number; + outboundTotal: number; /** - * Aggregated stats for total network bandwidth. + * Aggregated number of outbound bandwidth per period. */ - networkTotal: number; + outbound: Metric[]; /** - * Aggregated stats for total backups storage. + * Aggregated number of sites deployment per period. */ - backupsStorageTotal: number; + deployments: Metric[]; /** - * An array of aggregated number of screenshots generated. + * Aggregated number of sites deployment storage per period. */ - screenshotsGenerated: Metric[]; + deploymentsStorage: Metric[]; /** - * Total aggregated number of screenshots generated. + * Total aggregated number of successful site builds. */ - screenshotsGeneratedTotal: number; + buildsSuccessTotal: number; /** - * An array of aggregated number of Imagine credits in the given period. + * Total aggregated number of failed site builds. */ - imagineCredits: Metric[]; + buildsFailedTotal: number; /** - * Total aggregated number of Imagine credits. + * Aggregated number of sites build per period. */ - imagineCreditsTotal: number; + builds: Metric[]; /** - * Current aggregated number of open Realtime connections. + * Aggregated sum of sites build storage per period. */ - realtimeConnectionsTotal: number; + buildsStorage: Metric[]; /** - * Total number of Realtime messages sent to clients. + * Aggregated sum of sites build compute time per period. */ - realtimeMessagesTotal: number; + buildsTime: Metric[]; /** - * Total consumed Realtime bandwidth (in bytes). + * Aggregated sum of sites build mbSeconds per period. */ - realtimeBandwidthTotal: number; + buildsMbSeconds: Metric[]; /** - * Aggregated number of open Realtime connections per period. + * Aggregated number of sites execution per period. */ - realtimeConnections: Metric[]; + executions: Metric[]; /** - * Aggregated number of Realtime messages sent to clients per period. + * Aggregated number of sites execution compute time per period. */ - realtimeMessages: Metric[]; + executionsTime: Metric[]; /** - * Aggregated consumed Realtime bandwidth (in bytes) per period. + * Aggregated number of sites mbSeconds per period. */ - realtimeBandwidth: Metric[]; - } - - /** - * Projects List - */ - export type ProjectList = { + executionsMbSeconds: Metric[]; /** - * Total number of projects that matched your query. + * Aggregated number of successful site builds per period. */ - total: number; + buildsSuccess: Metric[]; /** - * List of projects. + * Aggregated number of failed site builds per period. */ - projects: Project[]; + buildsFailed: Metric[]; } /** - * Project + * UsageSite */ - export type Project = { - /** - * Project ID. - */ - $id: string; - /** - * Project creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Project update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Project name. - */ - name: string; + export type UsageSite = { /** - * Project description. + * The time range of the usage stats. */ - description: string; + range: string; /** - * Project team ID. + * Total aggregated number of function deployments. */ - teamId: string; + deploymentsTotal: number; /** - * Project logo file ID. + * Total aggregated sum of function deployments storage. */ - logo: string; + deploymentsStorageTotal: number; /** - * Project website URL. + * Total aggregated number of function builds. */ - url: string; + buildsTotal: number; /** - * Company legal name. + * Total aggregated number of successful function builds. */ - legalName: string; + buildsSuccessTotal: number; /** - * Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format. + * Total aggregated number of failed function builds. */ - legalCountry: string; + buildsFailedTotal: number; /** - * State name. + * total aggregated sum of function builds storage. */ - legalState: string; + buildsStorageTotal: number; /** - * City name. + * Total aggregated sum of function builds compute time. */ - legalCity: string; + buildsTimeTotal: number; /** - * Company Address. + * Average builds compute time. */ - legalAddress: string; + buildsTimeAverage: number; /** - * Company Tax ID. + * Total aggregated sum of function builds mbSeconds. */ - legalTaxId: string; + buildsMbSecondsTotal: number; /** - * Session duration in seconds. + * Total aggregated number of function executions. */ - authDuration: number; + executionsTotal: number; /** - * Max users allowed. 0 is unlimited. + * Total aggregated sum of function executions compute time. */ - authLimit: number; + executionsTimeTotal: number; /** - * Max sessions allowed per user. 100 maximum. + * Total aggregated sum of function executions mbSeconds. */ - authSessionsLimit: number; + executionsMbSecondsTotal: number; /** - * Max allowed passwords in the history list per user. Max passwords limit allowed in history is 20. Use 0 for disabling password history. + * Aggregated number of function deployments per period. */ - authPasswordHistory: number; + deployments: Metric[]; /** - * Whether or not to check user's password against most commonly used passwords. + * Aggregated number of function deployments storage per period. */ - authPasswordDictionary: boolean; + deploymentsStorage: Metric[]; /** - * Whether or not to check the user password for similarity with their personal data. + * Aggregated number of function builds per period. */ - authPersonalDataCheck: boolean; + builds: Metric[]; /** - * An array of mock numbers and their corresponding verification codes (OTPs). + * Aggregated sum of function builds storage per period. */ - authMockNumbers: MockNumber[]; + buildsStorage: Metric[]; /** - * Whether or not to send session alert emails to users. + * Aggregated sum of function builds compute time per period. */ - authSessionAlerts: boolean; + buildsTime: Metric[]; /** - * Whether or not to show user names in the teams membership response. + * Aggregated number of function builds mbSeconds per period. */ - authMembershipsUserName: boolean; + buildsMbSeconds: Metric[]; /** - * Whether or not to show user emails in the teams membership response. + * Aggregated number of function executions per period. */ - authMembershipsUserEmail: boolean; + executions: Metric[]; /** - * Whether or not to show user MFA status in the teams membership response. + * Aggregated number of function executions compute time per period. */ - authMembershipsMfa: boolean; + executionsTime: Metric[]; /** - * Whether or not all existing sessions should be invalidated on password change + * Aggregated number of function mbSeconds per period. */ - authInvalidateSessions: boolean; + executionsMbSeconds: Metric[]; /** - * List of Auth Providers. + * Aggregated number of successful builds per period. */ - oAuthProviders: AuthProvider[]; + buildsSuccess: Metric[]; /** - * List of Platforms. + * Aggregated number of failed builds per period. */ - platforms: Platform[]; + buildsFailed: Metric[]; /** - * List of Webhooks. + * Total aggregated number of requests. */ - webhooks: Webhook[]; + requestsTotal: number; /** - * List of API Keys. + * Aggregated number of requests per period. */ - keys: Key[]; + requests: Metric[]; /** - * List of dev keys. + * Total aggregated inbound bandwidth. */ - devKeys: DevKey[]; + inboundTotal: number; /** - * Status for custom SMTP + * Aggregated number of inbound bandwidth per period. */ - smtpEnabled: boolean; + inbound: Metric[]; /** - * SMTP sender name + * Total aggregated outbound bandwidth. */ - smtpSenderName: string; + outboundTotal: number; /** - * SMTP sender email + * Aggregated number of outbound bandwidth per period. */ - smtpSenderEmail: string; + outbound: Metric[]; + } + + /** + * UsageProject + */ + export type UsageProject = { /** - * SMTP reply to email + * Total aggregated number of function executions. */ - smtpReplyTo: string; + executionsTotal: number; /** - * SMTP server host name + * Total aggregated number of documents in legacy/tablesdb. */ - smtpHost: string; + documentsTotal: number; /** - * SMTP server port + * Total aggregated number of documents in documentsdb. */ - smtpPort: number; + documentsdbDocumentsTotal: number; /** - * SMTP server username + * Total aggregated number of rows. */ - smtpUsername: string; + rowsTotal: number; /** - * SMTP server password + * Total aggregated number of databases. */ - smtpPassword: string; + databasesTotal: number; /** - * SMTP server secure protocol + * Total aggregated number of documentsdb. */ - smtpSecure: string; + documentsdbTotal: number; /** - * Number of times the ping was received for this project. + * Total aggregated sum of databases storage size (in bytes). */ - pingCount: number; + databasesStorageTotal: number; /** - * Last ping datetime in ISO 8601 format. + * Total aggregated sum of documentsdb databases storage size (in bytes). */ - pingedAt: string; + documentsdbDatabasesStorageTotal: number; /** - * Labels for the project. + * Total aggregated number of users. */ - labels: string[]; + usersTotal: number; /** - * Project status + * Total aggregated sum of files storage size (in bytes). */ - status: string; + filesStorageTotal: number; /** - * Email/Password auth method status + * Total aggregated sum of functions storage size (in bytes). */ - authEmailPassword: boolean; + functionsStorageTotal: number; /** - * Magic URL auth method status + * Total aggregated sum of builds storage size (in bytes). */ - authUsersAuthMagicURL: boolean; + buildsStorageTotal: number; /** - * Email (OTP) auth method status + * Total aggregated sum of deployments storage size (in bytes). */ - authEmailOtp: boolean; + deploymentsStorageTotal: number; /** - * Anonymous auth method status + * Total aggregated number of buckets. */ - authAnonymous: boolean; + bucketsTotal: number; /** - * Invites auth method status + * Total aggregated number of function executions mbSeconds. */ - authInvites: boolean; + executionsMbSecondsTotal: number; /** - * JWT auth method status + * Total aggregated number of function builds mbSeconds. */ - authJWT: boolean; + buildsMbSecondsTotal: number; /** - * Phone auth method status + * Aggregated stats for total databases reads. */ - authPhone: boolean; + databasesReadsTotal: number; /** - * Account service status + * Aggregated stats for total databases writes. */ - serviceStatusForAccount: boolean; + databasesWritesTotal: number; /** - * Avatars service status + * Total number of documentsdb databases reads. */ - serviceStatusForAvatars: boolean; + documentsdbDatabasesReadsTotal: number; /** - * Databases (legacy) service status + * Total number of documentsdb databases writes. */ - serviceStatusForDatabases: boolean; + documentsdbDatabasesWritesTotal: number; /** - * TablesDB service status + * Aggregated number of requests per period. */ - serviceStatusForTablesdb: boolean; + requests: Metric[]; /** - * Locale service status + * Aggregated number of consumed bandwidth per period. */ - serviceStatusForLocale: boolean; + network: Metric[]; /** - * Health service status + * Aggregated number of users per period. */ - serviceStatusForHealth: boolean; + users: Metric[]; /** - * Storage service status + * Aggregated number of executions per period. */ - serviceStatusForStorage: boolean; + executions: Metric[]; /** - * Teams service status + * Aggregated breakdown in totals of executions by functions. */ - serviceStatusForTeams: boolean; + executionsBreakdown: MetricBreakdown[]; /** - * Users service status + * Aggregated breakdown in totals of usage by buckets. */ - serviceStatusForUsers: boolean; + bucketsBreakdown: MetricBreakdown[]; /** - * Sites service status + * An array of the aggregated breakdown of storage usage by databases. */ - serviceStatusForSites: boolean; + databasesStorageBreakdown: MetricBreakdown[]; /** - * Functions service status + * Aggregated breakdown in totals of execution mbSeconds by functions. */ - serviceStatusForFunctions: boolean; + executionsMbSecondsBreakdown: MetricBreakdown[]; /** - * GraphQL service status + * Aggregated breakdown in totals of build mbSeconds by functions. */ - serviceStatusForGraphql: boolean; + buildsMbSecondsBreakdown: MetricBreakdown[]; /** - * Messaging service status + * Aggregated breakdown in totals of functions storage size (in bytes). */ - serviceStatusForMessaging: boolean; + functionsStorageBreakdown: MetricBreakdown[]; /** - * Project region + * Aggregated stats for total auth phone. */ - region: string; + authPhoneTotal: number; /** - * Billing limits reached + * Aggregated stats for total auth phone estimation. */ - billingLimits: BillingLimits; + authPhoneEstimate: number; /** - * Project blocks information + * Aggregated breakdown in totals of phone auth by country. */ - blocks: Block[]; + authPhoneCountryBreakdown: MetricBreakdown[]; /** - * Last time the project was accessed via console. Used with plan's projectInactivityDays to determine if project is paused. + * Aggregated stats for database reads. */ - consoleAccessedAt: string; - } - - /** - * Dev Keys List - */ - export type DevKeyList = { + databasesReads: Metric[]; /** - * Total number of devKeys that matched your query. + * Aggregated stats for database writes. */ - total: number; + databasesWrites: Metric[]; /** - * List of devKeys. + * An array of aggregated number of documentsdb database reads. */ - devKeys: DevKey[]; - } - - /** - * DevKey - */ - export type DevKey = { + documentsdbDatabasesReads: Metric[]; /** - * Key ID. + * An array of aggregated number of documentsdb database writes. */ - $id: string; + documentsdbDatabasesWrites: Metric[]; /** - * Key creation date in ISO 8601 format. + * An array of aggregated sum of documentsdb databases storage size (in bytes) per period. */ - $createdAt: string; + documentsdbDatabasesStorage: Metric[]; /** - * Key update date in ISO 8601 format. + * An array of aggregated number of image transformations. */ - $updatedAt: string; + imageTransformations: Metric[]; /** - * Key name. + * Total aggregated number of image transformations. */ - name: string; + imageTransformationsTotal: number; /** - * Key expiration date in ISO 8601 format. + * Total aggregated number of VectorsDB databases. */ - expire: string; + vectorsdbDatabasesTotal: number; /** - * Secret key. + * Total aggregated number of VectorsDB collections. */ - secret: string; + vectorsdbCollectionsTotal: number; /** - * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + * Total aggregated number of VectorsDB documents. */ - accessedAt: string; + vectorsdbDocumentsTotal: number; /** - * List of SDK user agents that used this key. + * Total aggregated VectorsDB storage (bytes). */ - sdks: string[]; - } - - /** - * Platforms List - */ - export type PlatformList = { + vectorsdbDatabasesStorageTotal: number; /** - * Total number of platforms that matched your query. + * Total aggregated number of VectorsDB reads. */ - total: number; + vectorsdbDatabasesReadsTotal: number; /** - * List of platforms. + * Total aggregated number of VectorsDB writes. */ - platforms: Platform[]; - } - - /** - * Platform - */ - export type Platform = { + vectorsdbDatabasesWritesTotal: number; /** - * Platform ID. + * Aggregated VectorsDB databases per period. */ - $id: string; + vectorsdbDatabases: Metric[]; /** - * Platform creation date in ISO 8601 format. + * Aggregated VectorsDB collections per period. */ - $createdAt: string; + vectorsdbCollections: Metric[]; /** - * Platform update date in ISO 8601 format. + * Aggregated VectorsDB documents per period. */ - $updatedAt: string; + vectorsdbDocuments: Metric[]; /** - * Platform name. + * Aggregated VectorsDB storage per period. */ - name: string; + vectorsdbDatabasesStorage: Metric[]; /** - * Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android. + * Aggregated VectorsDB reads per period. */ - type: PlatformType; + vectorsdbDatabasesReads: Metric[]; /** - * Platform Key. iOS bundle ID or Android package name. Empty string for other platforms. + * Aggregated VectorsDB writes per period. */ - key: string; + vectorsdbDatabasesWrites: Metric[]; /** - * App store or Google Play store ID. + * Aggregated number of text embedding calls per period. */ - store: string; + embeddingsText: Metric; /** - * Web app hostname. Empty string for other platforms. + * Aggregated number of tokens processed by text embeddings per period. */ - hostname: string; + embeddingsTextTokens: Metric; /** - * HTTP basic authentication username. + * Aggregated duration spent generating text embeddings per period. */ - httpUser: string; + embeddingsTextDuration: Metric; /** - * HTTP basic authentication password. + * Aggregated number of errors while generating text embeddings per period. */ - httpPass: string; - } - - /** - * Schedules List - */ - export type ScheduleList = { + embeddingsTextErrors: Metric; /** - * Total number of schedules that matched your query. + * Total aggregated number of text embedding calls. */ - total: number; + embeddingsTextTotal: Metric; /** - * List of schedules. + * Total aggregated number of tokens processed by text. */ - schedules: Schedule[]; - } - - /** - * Schedule - */ - export type Schedule = { + embeddingsTextTokensTotal: Metric; /** - * Schedule ID. + * Total aggregated duration spent generating text embeddings. */ - $id: string; + embeddingsTextDurationTotal: Metric; /** - * Schedule creation date in ISO 8601 format. + * Total aggregated number of errors while generating text embeddings. */ - $createdAt: string; + embeddingsTextErrorsTotal: Metric; /** - * Schedule update date in ISO 8601 format. + * Aggregated number of function executions per period. */ - $updatedAt: string; + functionsExecutions: Metric[]; /** - * The resource type associated with this schedule. + * Total aggregated number of function executions. */ - resourceType: string; + functionsExecutionsTotal: number; /** - * The resource ID associated with this schedule. + * Aggregated number of site executions per period. */ - resourceId: string; + sitesExecutions: Metric[]; /** - * Change-tracking timestamp used by the scheduler to detect resource changes in ISO 8601 format. + * Total aggregated number of site executions. */ - resourceUpdatedAt: string; + sitesExecutionsTotal: number; /** - * The project ID associated with this schedule. + * Aggregated stats for total network bandwidth. */ - projectId: string; + networkTotal: number; /** - * The CRON schedule expression. + * Aggregated stats for total backups storage. */ - schedule: string; + backupsStorageTotal: number; /** - * Schedule data used to store resource-specific context needed for execution. + * An array of aggregated number of screenshots generated. */ - data: object; + screenshotsGenerated: Metric[]; /** - * Whether the schedule is active. + * Total aggregated number of screenshots generated. */ - active: boolean; + screenshotsGeneratedTotal: number; /** - * The region where the schedule is deployed. + * An array of aggregated number of Imagine credits in the given period. */ - region: string; - } - - /** - * EmailTemplate - */ - export type EmailTemplate = { + imagineCredits: Metric[]; /** - * Template type + * Total aggregated number of Imagine credits. */ - type: string; + imagineCreditsTotal: number; /** - * Template locale + * Current aggregated number of open Realtime connections. */ - locale: string; + realtimeConnectionsTotal: number; /** - * Template message + * Total number of Realtime messages sent to clients. */ - message: string; + realtimeMessagesTotal: number; /** - * Name of the sender + * Total consumed Realtime bandwidth (in bytes). */ - senderName: string; + realtimeBandwidthTotal: number; /** - * Email of the sender + * Aggregated number of open Realtime connections per period. */ - senderEmail: string; + realtimeConnections: Metric[]; /** - * Reply to email address + * Aggregated number of Realtime messages sent to clients per period. */ - replyTo: string; + realtimeMessages: Metric[]; /** - * Email subject + * Aggregated consumed Realtime bandwidth (in bytes) per period. */ - subject: string; + realtimeBandwidth: Metric[]; } /** - * SmsTemplate + * Headers */ - export type SmsTemplate = { - /** - * Template type - */ - type: string; + export type Headers = { /** - * Template locale + * Header name. */ - locale: string; + name: string; /** - * Template message + * Header value. */ - message: string; + value: string; } /** - * Rule List + * Specification */ - export type ProxyRuleList = { + export type Specification = { /** - * Total number of rules that matched your query. + * Memory size in MB. */ - total: number; + memory: number; /** - * List of rules. + * Number of CPUs. */ - rules: ProxyRule[]; + cpus: number; + /** + * Is size enabled. + */ + enabled: boolean; + /** + * Size slug. + */ + slug: string; } /** @@ -6057,2376 +6360,2167 @@ export namespace Models { } /** - * Sites List - */ - export type SiteList = { - /** - * Total number of sites that matched your query. - */ - total: number; - /** - * List of sites. - */ - sites: Site[]; - } - - /** - * Site + * Schedule */ - export type Site = { - /** - * Site ID. - */ - $id: string; - /** - * Site creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Site update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Site name. - */ - name: string; - /** - * Site enabled. - */ - enabled: boolean; - /** - * Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration. - */ - live: boolean; - /** - * When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. - */ - logging: boolean; - /** - * Site framework. - */ - framework: string; - /** - * How many days to keep the non-active deployments before they will be automatically deleted. - */ - deploymentRetention: number; - /** - * Site's active deployment ID. - */ - deploymentId: string; - /** - * Active deployment creation date in ISO 8601 format. - */ - deploymentCreatedAt: string; - /** - * Screenshot of active deployment with light theme preference file ID. - */ - deploymentScreenshotLight: string; - /** - * Screenshot of active deployment with dark theme preference file ID. - */ - deploymentScreenshotDark: string; - /** - * Site's latest deployment ID. - */ - latestDeploymentId: string; - /** - * Latest deployment creation date in ISO 8601 format. - */ - latestDeploymentCreatedAt: string; - /** - * Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed". - */ - latestDeploymentStatus: string; - /** - * Site variables. - */ - vars: Variable[]; - /** - * Site request timeout in seconds. - */ - timeout: number; - /** - * The install command used to install the site dependencies. - */ - installCommand: string; - /** - * The build command used to build the site. - */ - buildCommand: string; - /** - * Custom command to use when starting site runtime. - */ - startCommand: string; - /** - * The directory where the site build output is located. - */ - outputDirectory: string; - /** - * Site VCS (Version Control System) installation id. - */ - installationId: string; + export type Schedule = { /** - * VCS (Version Control System) Repository ID + * Schedule ID. */ - providerRepositoryId: string; + $id: string; /** - * VCS (Version Control System) branch name + * Schedule creation date in ISO 8601 format. */ - providerBranch: string; + $createdAt: string; /** - * Path to site in VCS (Version Control System) repository + * Schedule update date in ISO 8601 format. */ - providerRootDirectory: string; + $updatedAt: string; /** - * 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 + * The resource type associated with this schedule. */ - providerSilentMode: boolean; + resourceType: string; /** - * Machine specification for deployment builds. + * The resource ID associated with this schedule. */ - buildSpecification: string; + resourceId: string; /** - * Machine specification for SSR executions. + * Change-tracking timestamp used by the scheduler to detect resource changes in ISO 8601 format. */ - runtimeSpecification: string; + resourceUpdatedAt: string; /** - * Site build runtime. + * The project ID associated with this schedule. */ - buildRuntime: string; + projectId: string; /** - * Site framework adapter. + * The CRON schedule expression. */ - adapter: string; + schedule: string; /** - * Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. + * Schedule data used to store resource-specific context needed for execution. */ - fallbackFile: string; - } - - /** - * Frameworks List - */ - export type FrameworkList = { + data: object; /** - * Total number of frameworks that matched your query. + * Whether the schedule is active. */ - total: number; + active: boolean; /** - * List of frameworks. + * The region where the schedule is deployed. */ - frameworks: Framework[]; + region: string; } /** - * Site Templates List + * SmsTemplate */ - export type TemplateSiteList = { + export type SmsTemplate = { /** - * Total number of templates that matched your query. + * Template type */ - total: number; + type: string; /** - * List of templates. + * Template locale */ - templates: TemplateSite[]; + locale: string; + /** + * Template message + */ + message: string; } /** - * Template Site + * EmailTemplate */ - export type TemplateSite = { + export type EmailTemplate = { /** - * Site Template ID. + * Template type */ - key: string; + type: string; /** - * Site Template Name. + * Template locale */ - name: string; + locale: string; /** - * Short description of template + * Template message */ - tagline: string; + message: string; /** - * URL hosting a template demo. + * Name of the sender */ - demoUrl: string; + senderName: string; /** - * File URL with preview screenshot in dark theme preference. + * Email of the sender */ - screenshotDark: string; + senderEmail: string; /** - * File URL with preview screenshot in light theme preference. + * Reply to email address */ - screenshotLight: string; + replyTo: string; /** - * Site use cases. + * Email subject */ - useCases: string[]; + subject: string; + } + + /** + * Console Variables + */ + export type ConsoleVariables = { /** - * List of frameworks that can be used with this template. + * CNAME target for your Appwrite custom domains. */ - frameworks: TemplateFramework[]; + _APP_DOMAIN_TARGET_CNAME: string; /** - * VCS (Version Control System) Provider. + * A target for your Appwrite custom domains. */ - vcsProvider: string; + _APP_DOMAIN_TARGET_A: string; /** - * VCS (Version Control System) Repository ID + * Maximum build timeout in seconds. */ - providerRepositoryId: string; + _APP_COMPUTE_BUILD_TIMEOUT: number; /** - * VCS (Version Control System) Owner. + * AAAA target for your Appwrite custom domains. */ - providerOwner: string; + _APP_DOMAIN_TARGET_AAAA: string; /** - * VCS (Version Control System) branch version (tag). + * CAA target for your Appwrite custom domains. */ - providerVersion: string; + _APP_DOMAIN_TARGET_CAA: string; /** - * Site variables. + * Maximum file size allowed for file upload in bytes. */ - variables: TemplateVariable[]; - } - - /** - * UsageSites - */ - export type UsageSites = { + _APP_STORAGE_LIMIT: number; /** - * Time range of the usage stats. + * Maximum file size allowed for deployment in bytes. */ - range: string; + _APP_COMPUTE_SIZE_LIMIT: number; /** - * Total aggregated number of sites. + * Defines if usage stats are enabled. This value is set to 'enabled' by default, to disable the usage stats set the value to 'disabled'. */ - sitesTotal: number; + _APP_USAGE_STATS: string; /** - * Aggregated number of sites per period. + * Defines if VCS (Version Control System) is enabled. */ - sites: Metric[]; + _APP_VCS_ENABLED: boolean; /** - * Total aggregated number of sites deployments. + * Defines if main domain is configured. If so, custom domains can be created. */ - deploymentsTotal: number; + _APP_DOMAIN_ENABLED: boolean; /** - * Total aggregated sum of sites deployment storage. + * Defines if AI assistant is enabled. */ - deploymentsStorageTotal: number; + _APP_ASSISTANT_ENABLED: boolean; /** - * Total aggregated number of sites build. + * A comma separated list of domains to use for site URLs. */ - buildsTotal: number; + _APP_DOMAIN_SITES: string; /** - * total aggregated sum of sites build storage. + * A domain to use for function URLs. */ - buildsStorageTotal: number; + _APP_DOMAIN_FUNCTIONS: string; /** - * Total aggregated sum of sites build compute time. + * Defines if HTTPS is enforced for all requests. */ - buildsTimeTotal: number; + _APP_OPTIONS_FORCE_HTTPS: string; /** - * Total aggregated sum of sites build mbSeconds. + * Comma-separated list of nameservers. */ - buildsMbSecondsTotal: number; + _APP_DOMAINS_NAMESERVERS: string; /** - * Total aggregated number of sites execution. + * Database adapter in use. */ - executionsTotal: number; + _APP_DB_ADAPTER: string; /** - * Total aggregated sum of sites execution compute time. + * Whether the database adapter supports relationships. */ - executionsTimeTotal: number; + supportForRelationships: boolean; /** - * Total aggregated sum of sites execution mbSeconds. + * Whether the database adapter supports operators. */ - executionsMbSecondsTotal: number; + supportForOperators: boolean; /** - * Total aggregated number of requests. + * Whether the database adapter supports spatial attributes. */ - requestsTotal: number; + supportForSpatials: boolean; /** - * Aggregated number of requests per period. + * Whether the database adapter supports spatial indexes on nullable columns. */ - requests: Metric[]; + supportForSpatialIndexNull: boolean; /** - * Total aggregated inbound bandwidth. + * Whether the database adapter supports fulltext wildcard search. */ - inboundTotal: number; + supportForFulltextWildcard: boolean; /** - * Aggregated number of inbound bandwidth per period. + * Whether the database adapter supports multiple fulltext indexes per collection. */ - inbound: Metric[]; + supportForMultipleFulltextIndexes: boolean; /** - * Total aggregated outbound bandwidth. + * Whether the database adapter supports resizing attributes. */ - outboundTotal: number; + supportForAttributeResizing: boolean; /** - * Aggregated number of outbound bandwidth per period. + * Whether the database adapter supports fixed schemas with row width limits. */ - outbound: Metric[]; + supportForSchemas: boolean; /** - * Aggregated number of sites deployment per period. + * Maximum index length supported by the database adapter. */ - deployments: Metric[]; + maxIndexLength: number; /** - * Aggregated number of sites deployment storage per period. + * Whether the database adapter uses integer sequence IDs. */ - deploymentsStorage: Metric[]; + supportForIntegerIds: boolean; + } + + /** + * MFA Challenge + */ + export type MfaChallenge = { /** - * Total aggregated number of successful site builds. + * Token ID. */ - buildsSuccessTotal: number; + $id: string; /** - * Total aggregated number of failed site builds. + * Token creation date in ISO 8601 format. */ - buildsFailedTotal: number; + $createdAt: string; /** - * Aggregated number of sites build per period. + * User ID. */ - builds: Metric[]; + userId: string; /** - * Aggregated sum of sites build storage per period. + * Token expiration date in ISO 8601 format. */ - buildsStorage: Metric[]; + expire: string; + } + + /** + * MFA Recovery Codes + */ + export type MfaRecoveryCodes = { /** - * Aggregated sum of sites build compute time per period. + * Recovery codes. */ - buildsTime: Metric[]; + recoveryCodes: string[]; + } + + /** + * MFAType + */ + export type MfaType = { /** - * Aggregated sum of sites build mbSeconds per period. + * Secret token used for TOTP factor. */ - buildsMbSeconds: Metric[]; + secret: string; /** - * Aggregated number of sites execution per period. + * URI for authenticator apps. */ - executions: Metric[]; + uri: string; + } + + /** + * MFAFactors + */ + export type MfaFactors = { /** - * Aggregated number of sites execution compute time per period. + * Can TOTP be used for MFA challenge for this account. */ - executionsTime: Metric[]; + totp: boolean; /** - * Aggregated number of sites mbSeconds per period. + * Can phone (SMS) be used for MFA challenge for this account. */ - executionsMbSeconds: Metric[]; + phone: boolean; /** - * Aggregated number of successful site builds per period. + * Can email be used for MFA challenge for this account. */ - buildsSuccess: Metric[]; + email: boolean; /** - * Aggregated number of failed site builds per period. + * Can recovery code be used for MFA challenge for this account. */ - buildsFailed: Metric[]; + recoveryCode: boolean; } /** - * UsageSite + * Provider */ - export type UsageSite = { + export type Provider = { /** - * The time range of the usage stats. + * Provider ID. */ - range: string; + $id: string; /** - * Total aggregated number of function deployments. + * Provider creation time in ISO 8601 format. */ - deploymentsTotal: number; + $createdAt: string; /** - * Total aggregated sum of function deployments storage. + * Provider update date in ISO 8601 format. */ - deploymentsStorageTotal: number; + $updatedAt: string; /** - * Total aggregated number of function builds. + * The name for the provider instance. */ - buildsTotal: number; + name: string; /** - * Total aggregated number of successful function builds. + * The name of the provider service. */ - buildsSuccessTotal: number; + provider: string; /** - * Total aggregated number of failed function builds. + * Is provider enabled? */ - buildsFailedTotal: number; + enabled: boolean; /** - * total aggregated sum of function builds storage. + * Type of provider. */ - buildsStorageTotal: number; + type: string; /** - * Total aggregated sum of function builds compute time. + * Provider credentials. */ - buildsTimeTotal: number; + credentials: object; /** - * Average builds compute time. + * Provider options. */ - buildsTimeAverage: number; + options?: object; + } + + /** + * Message + */ + export type Message = { /** - * Total aggregated sum of function builds mbSeconds. + * Message ID. */ - buildsMbSecondsTotal: number; + $id: string; /** - * Total aggregated number of function executions. + * Message creation time in ISO 8601 format. */ - executionsTotal: number; + $createdAt: string; /** - * Total aggregated sum of function executions compute time. + * Message update date in ISO 8601 format. */ - executionsTimeTotal: number; + $updatedAt: string; /** - * Total aggregated sum of function executions mbSeconds. + * Message provider type. */ - executionsMbSecondsTotal: number; + providerType: string; /** - * Aggregated number of function deployments per period. + * Topic IDs set as recipients. */ - deployments: Metric[]; + topics: string[]; /** - * Aggregated number of function deployments storage per period. + * User IDs set as recipients. */ - deploymentsStorage: Metric[]; + users: string[]; /** - * Aggregated number of function builds per period. + * Target IDs set as recipients. */ - builds: Metric[]; + targets: string[]; /** - * Aggregated sum of function builds storage per period. + * The scheduled time for message. */ - buildsStorage: Metric[]; + scheduledAt?: string; /** - * Aggregated sum of function builds compute time per period. + * The time when the message was delivered. */ - buildsTime: Metric[]; + deliveredAt?: string; /** - * Aggregated number of function builds mbSeconds per period. + * Delivery errors if any. */ - buildsMbSeconds: Metric[]; + deliveryErrors?: string[]; /** - * Aggregated number of function executions per period. + * Number of recipients the message was delivered to. */ - executions: Metric[]; + deliveredTotal: number; /** - * Aggregated number of function executions compute time per period. + * Data of the message. */ - executionsTime: Metric[]; + data: object; /** - * Aggregated number of function mbSeconds per period. + * Status of delivery. */ - executionsMbSeconds: Metric[]; + status: MessageStatus; + } + + /** + * Topic + */ + export type Topic = { /** - * Aggregated number of successful builds per period. + * Topic ID. */ - buildsSuccess: Metric[]; + $id: string; /** - * Aggregated number of failed builds per period. + * Topic creation time in ISO 8601 format. */ - buildsFailed: Metric[]; + $createdAt: string; /** - * Total aggregated number of requests. + * Topic update date in ISO 8601 format. */ - requestsTotal: number; + $updatedAt: string; /** - * Aggregated number of requests per period. + * The name of the topic. */ - requests: Metric[]; + name: string; /** - * Total aggregated inbound bandwidth. + * Total count of email subscribers subscribed to the topic. */ - inboundTotal: number; + emailTotal: number; /** - * Aggregated number of inbound bandwidth per period. + * Total count of SMS subscribers subscribed to the topic. */ - inbound: Metric[]; + smsTotal: number; /** - * Total aggregated outbound bandwidth. + * Total count of push subscribers subscribed to the topic. */ - outboundTotal: number; + pushTotal: number; /** - * Aggregated number of outbound bandwidth per period. + * Subscribe permissions. */ - outbound: Metric[]; + subscribe: string[]; } /** - * Buckets List + * Transaction */ - export type BucketList = { + export type Transaction = { /** - * Total number of buckets that matched your query. + * Transaction ID. */ - total: number; + $id: string; /** - * List of buckets. + * Transaction creation time in ISO 8601 format. */ - buckets: Bucket[]; + $createdAt: string; + /** + * Transaction update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Current status of the transaction. One of: pending, committing, committed, rolled_back, failed. + */ + status: string; + /** + * Number of operations in the transaction. + */ + operations: number; + /** + * Expiration time in ISO 8601 format. + */ + expiresAt: string; } /** - * Bucket + * Subscriber */ - export type Bucket = { + export type Subscriber = { /** - * Bucket ID. + * Subscriber ID. */ $id: string; /** - * Bucket creation time in ISO 8601 format. + * Subscriber creation time in ISO 8601 format. */ $createdAt: string; /** - * Bucket update date in ISO 8601 format. + * Subscriber update date in ISO 8601 format. */ $updatedAt: string; /** - * Bucket permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * Target ID. */ - $permissions: string[]; + targetId: string; /** - * Whether file-level security is enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). + * Target. */ - fileSecurity: boolean; + target: Target; /** - * Bucket name. + * Topic ID. */ - name: string; + userId: string; /** - * Bucket enabled. + * User Name. */ - enabled: boolean; + userName: string; /** - * Maximum file size supported. + * Topic ID. */ - maximumFileSize: number; + topicId: string; /** - * Allowed file extensions. + * The target provider type. Can be one of the following: `email`, `sms` or `push`. */ - allowedFileExtensions: string[]; + providerType: string; + } + + /** + * Target + */ + export type Target = { /** - * Compression algorithm chosen for compression. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd). + * Target ID. */ - compression: string; + $id: string; /** - * Bucket is encrypted. + * Target creation time in ISO 8601 format. */ - encryption: boolean; + $createdAt: string; /** - * Virus scanning is enabled. + * Target update date in ISO 8601 format. */ - antivirus: boolean; + $updatedAt: string; /** - * Image transformations are enabled. + * Target Name. */ - transformations: boolean; + name: string; /** - * Total size of this bucket in bytes. + * User ID. */ - totalSize: number; - } - - /** - * Files List - */ - export type FileList = { + userId: string; + /** + * Provider ID. + */ + providerId?: string; /** - * Total number of files that matched your query. + * The target provider type. Can be one of the following: `email`, `sms` or `push`. */ - total: number; + providerType: string; /** - * List of files. + * The target identifier. */ - files: File[]; + identifier: string; + /** + * Is the target expired. + */ + expired: boolean; } /** - * File + * Migration */ - export type File = { + export type Migration = { /** - * File ID. + * Migration ID. */ $id: string; /** - * Bucket ID. - */ - bucketId: string; - /** - * File creation date in ISO 8601 format. + * Migration creation date in ISO 8601 format. */ $createdAt: string; /** - * File update date in ISO 8601 format. + * Variable creation date in ISO 8601 format. */ $updatedAt: string; /** - * File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * Migration status ( pending, processing, failed, completed ) */ - $permissions: string[]; + status: string; /** - * File name. + * Migration stage ( init, processing, source-check, destination-check, migrating, finished ) */ - name: string; + stage: string; /** - * File MD5 signature. + * A string containing the type of source of the migration. */ - signature: string; + source: string; /** - * File mime type. + * A string containing the type of destination of the migration. */ - mimeType: string; + destination: string; /** - * File original size in bytes. + * Resources to migrate. */ - sizeOriginal: number; + resources: string[]; /** - * Total number of chunks available + * Id of the resource to migrate. */ - chunksTotal: number; + resourceId: string; /** - * Total number of chunks uploaded + * A group of counters that represent the total progress of the migration. */ - chunksUploaded: number; + statusCounters: object; /** - * Whether file contents are encrypted at rest. + * An array of objects containing the report data of the resources that were migrated. */ - encryption: boolean; + resourceData: object; /** - * Compression algorithm used for the file. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd). + * All errors that occurred during the migration process. */ - compression: string; + errors: string[]; + /** + * Migration options used during the migration process. + */ + options: object; } /** - * StorageUsage + * Migration Report */ - export type UsageStorage = { - /** - * Time range of the usage stats. - */ - range: string; - /** - * Total aggregated number of buckets - */ - bucketsTotal: number; + export type MigrationReport = { /** - * Total aggregated number of files. + * Number of users to be migrated. */ - filesTotal: number; + user: number; /** - * Total aggregated number of files storage (in bytes). + * Number of teams to be migrated. */ - filesStorageTotal: number; + team: number; /** - * Aggregated number of buckets per period. + * Number of databases to be migrated. */ - buckets: Metric[]; + database: number; /** - * Aggregated number of files per period. + * Number of rows to be migrated. */ - files: Metric[]; + row: number; /** - * Aggregated number of files storage (in bytes) per period . + * Number of files to be migrated. */ - storage: Metric[]; - } - - /** - * UsageBuckets - */ - export type UsageBuckets = { + file: number; /** - * Time range of the usage stats. + * Number of buckets to be migrated. */ - range: string; + bucket: number; /** - * Total aggregated number of bucket files. + * Number of functions to be migrated. */ - filesTotal: number; + function: number; /** - * Total aggregated number of bucket files storage (in bytes). + * Number of sites to be migrated. */ - filesStorageTotal: number; + site: number; /** - * Aggregated number of bucket files per period. + * Number of providers to be migrated. */ - files: Metric[]; + provider: number; /** - * Aggregated number of bucket storage files (in bytes) per period. + * Number of topics to be migrated. */ - storage: Metric[]; + topic: number; /** - * Aggregated number of files transformations per period. + * Number of subscribers to be migrated. */ - imageTransformations: Metric[]; + subscriber: number; /** - * Total aggregated number of files transformations. + * Number of messages to be migrated. */ - imageTransformationsTotal: number; - } - - /** - * Tables List - */ - export type TableList = { + message: number; /** - * Total number of tables that matched your query. + * Size of files to be migrated in mb. */ - total: number; + size: number; /** - * List of tables. + * Version of the Appwrite instance to be migrated. */ - tables: Table[]; + version: string; } /** - * Table + * ActivityEvent */ - export type Table = { + export type ActivityEvent = { /** - * Table ID. + * Event ID. */ $id: string; /** - * Table creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Table update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Table permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - */ - $permissions: string[]; - /** - * Database ID. + * User type. */ - databaseId: string; + userType: string; /** - * Table name. + * User ID. */ - name: string; + userId: string; /** - * Table enabled. Can be 'enabled' or 'disabled'. When disabled, the table is inaccessible to users, but remains accessible to Server SDKs using API keys. + * User Email. */ - enabled: boolean; + userEmail: string; /** - * Whether row-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions). + * User Name. */ - rowSecurity: boolean; + userName: string; /** - * Table columns. + * Resource parent. */ - columns: (Models.ColumnBoolean | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail | Models.ColumnEnum | Models.ColumnUrl | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship | Models.ColumnPoint | Models.ColumnLine | Models.ColumnPolygon | Models.ColumnVarchar | Models.ColumnText | Models.ColumnMediumtext | Models.ColumnLongtext | Models.ColumnString)[]; + resourceParent: string; /** - * Table indexes. + * Resource type. */ - indexes: ColumnIndex[]; + resourceType: string; /** - * Maximum row size in bytes. Returns 0 when no limit applies. + * Resource ID. */ - bytesMax: number; + resourceId: string; /** - * Currently used row size in bytes based on defined columns. + * Resource. */ - bytesUsed: number; - } - - /** - * ColumnBoolean - */ - export type ColumnBoolean = { + resource: string; /** - * Column Key. + * Event name. */ - key: string; + event: string; /** - * Column type. + * User agent. */ - type: string; + userAgent: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * IP address. */ - status: ColumnStatus; + ip: string; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * API mode when event triggered. */ - error: string; + mode: string; /** - * Is column required? + * Location. */ - required: boolean; + country: string; /** - * Is column an array? + * Log creation date in ISO 8601 format. */ - array?: boolean; + time: string; /** - * Column creation date in ISO 8601 format. + * Project ID. */ - $createdAt: string; + projectId: string; /** - * Column update date in ISO 8601 format. + * Team ID. */ - $updatedAt: string; + teamId: string; /** - * Default value for column when not provided. Cannot be set when column is required. + * Hostname. */ - default?: boolean; - } - - /** - * ColumnDatetime - */ - export type ColumnDatetime = { + hostname: string; /** - * Column Key. + * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). */ - key: string; + osCode: string; /** - * Column type. + * Operating system name. */ - type: string; + osName: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Operating system version. */ - status: ColumnStatus; + osVersion: string; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Client type. */ - error: string; + clientType: string; /** - * Is column required? + * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). */ - required: boolean; + clientCode: string; /** - * Is column an array? + * Client name. */ - array?: boolean; + clientName: string; /** - * Column creation date in ISO 8601 format. + * Client version. */ - $createdAt: string; + clientVersion: string; /** - * Column update date in ISO 8601 format. + * Client engine name. */ - $updatedAt: string; + clientEngine: string; /** - * ISO 8601 format. + * Client engine name. */ - format: string; + clientEngineVersion: string; /** - * Default value for column when not provided. Only null is optional + * Device name. */ - default?: string; - } - - /** - * ColumnEmail - */ - export type ColumnEmail = { + deviceName: string; /** - * Column Key. + * Device brand name. */ - key: string; + deviceBrand: string; /** - * Column type. + * Device model name. */ - type: string; + deviceModel: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Country two-character ISO 3166-1 alpha code. */ - status: ColumnStatus; + countryCode: string; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Country name. */ - error: string; + countryName: string; + } + + /** + * AdditionalResource + */ + export type AdditionalResource = { /** - * Is column required? + * Resource name */ - required: boolean; + name: string; /** - * Is column an array? + * Resource unit */ - array?: boolean; + unit: string; /** - * Column creation date in ISO 8601 format. + * Price currency */ - $createdAt: string; + currency: string; /** - * Column update date in ISO 8601 format. + * Price */ - $updatedAt: string; + price: number; /** - * String format. + * Resource value */ - format: string; + value: number; /** - * Default value for column when not provided. Cannot be set when column is required. + * Description on invoice */ - default?: string; + invoiceDesc: string; } /** - * ColumnEnum + * AggregationTeam */ - export type ColumnEnum = { + export type AggregationTeam = { /** - * Column Key. + * Aggregation ID. */ - key: string; + $id: string; /** - * Column type. + * Aggregation creation time in ISO 8601 format. */ - type: string; + $createdAt: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Aggregation update date in ISO 8601 format. */ - status: ColumnStatus; + $updatedAt: string; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Aggregation permissions. [Learn more about permissions](/docs/permissions). */ - error: string; + $permissions: string[]; /** - * Is column required? + * Beginning date of the invoice */ - required: boolean; + from: string; /** - * Is column an array? + * End date of the invoice */ - array?: boolean; + to: string; /** - * Column creation date in ISO 8601 format. + * Total storage usage */ - $createdAt: string; + usageStorage: number; /** - * Column update date in ISO 8601 format. + * Total storage usage with builds storage */ - $updatedAt: string; + usageTotalStorage: number; /** - * Array of elements in enumerated type. + * Total files storage usage */ - elements: string[]; + usageFilesStorage: number; /** - * String format. + * Total deployments storage usage */ - format: string; + usageDeploymentsStorage: number; /** - * Default value for column when not provided. Cannot be set when column is required. + * Total builds storage usage */ - default?: string; - } - - /** - * ColumnFloat - */ - export type ColumnFloat = { + usageBuildsStorage: number; /** - * Column Key. + * Total databases storage usage */ - key: string; + usageDatabasesStorage: number; /** - * Column type. + * Total active users for the billing period */ - type: string; + usageUsers: number; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Total number of executions for the billing period */ - status: ColumnStatus; + usageExecutions: number; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Total bandwidth usage for the billing period */ - error: string; + usageBandwidth: number; /** - * Is column required? + * Peak concurrent realtime connections for the billing period */ - required: boolean; + usageRealtime: number; /** - * Is column an array? + * Total realtime messages sent for the billing period */ - array?: boolean; + usageRealtimeMessages: number; /** - * Column creation date in ISO 8601 format. + * Total realtime bandwidth usage for the billing period */ - $createdAt: string; + usageRealtimeBandwidth: number; /** - * Column update date in ISO 8601 format. + * Additional members */ - $updatedAt: string; + additionalMembers: number; /** - * Minimum value to enforce for new documents. + * Additional members cost */ - min?: number; + additionalMemberAmount: number; /** - * Maximum value to enforce for new documents. + * Additional storage usage cost */ - max?: number; + additionalStorageAmount: number; /** - * Default value for column when not provided. Cannot be set when column is required. + * Additional users usage cost. */ - default?: number; - } - - /** - * ColumnInteger - */ - export type ColumnInteger = { + additionalUsersAmount: number; /** - * Column Key. + * Additional executions usage cost */ - key: string; + additionalExecutionsAmount: number; /** - * Column type. + * Additional bandwidth usage cost */ - type: string; + additionalBandwidthAmount: number; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Additional realtime usage cost */ - status: ColumnStatus; + additionalRealtimeAmount: number; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Billing plan */ - error: string; + plan: string; /** - * Is column required? + * Aggregated amount */ - required: boolean; + amount: number; /** - * Is column an array? + * Aggregation project breakdown */ - array?: boolean; + breakdown: AggregationBreakdown[]; /** - * Column creation date in ISO 8601 format. + * Usage resources */ - $createdAt: string; + resources: UsageResources[]; + } + + /** + * AggregationBreakdown + */ + export type AggregationBreakdown = { /** - * Column update date in ISO 8601 format. + * Aggregation ID. */ - $updatedAt: string; + $id: string; /** - * Minimum value to enforce for new documents. + * Project name */ - min?: number | bigint; + name: string; /** - * Maximum value to enforce for new documents. + * Project region */ - max?: number | bigint; + region: string; /** - * Default value for column when not provided. Cannot be set when column is required. + * Aggregated amount */ - default?: number; + amount: number; + /** + * + */ + resources: UsageResources[]; } /** - * ColumnIP + * Archive */ - export type ColumnIp = { + export type BackupArchive = { /** - * Column Key. + * Archive ID. */ - key: string; + $id: string; + /** + * Archive creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Archive update date in ISO 8601 format. + */ + $updatedAt: string; /** - * Column type. + * Archive policy ID. */ - type: string; + policyId: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Archive size in bytes. */ - status: ColumnStatus; + size: number; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * The status of the archive creation. Possible values: pending, processing, uploading, completed, failed. */ - error: string; + status: string; /** - * Is column required? + * The backup start time. */ - required: boolean; + startedAt: string; /** - * Is column an array? + * Migration ID. */ - array?: boolean; + migrationId: string; /** - * Column creation date in ISO 8601 format. + * The services that are backed up by this archive. */ - $createdAt: string; + services: string[]; /** - * Column update date in ISO 8601 format. + * The resources that are backed up by this archive. */ - $updatedAt: string; + resources: string[]; /** - * String format. + * The resource ID to backup. Set only if this archive should backup a single resource. */ - format: string; + resourceId?: string; /** - * Default value for column when not provided. Cannot be set when column is required. + * The resource type to backup. Set only if this archive should backup a single resource. */ - default?: string; + resourceType?: string; } /** - * ColumnLine + * BillingAddress */ - export type ColumnLine = { - /** - * Column Key. - */ - key: string; + export type BillingAddress = { /** - * Column type. + * Region ID */ - type: string; + $id: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * User ID */ - status: ColumnStatus; + userId: string; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Street address */ - error: string; + streetAddress: string; /** - * Is column required? + * Address line 2 */ - required: boolean; + addressLine2: string; /** - * Is column an array? + * Address country */ - array?: boolean; + country: string; /** - * Column creation date in ISO 8601 format. + * city */ - $createdAt: string; + city: string; /** - * Column update date in ISO 8601 format. + * state */ - $updatedAt: string; + state: string; /** - * Default value for column when not provided. Cannot be set when column is required. + * postal code */ - default?: any[]; + postalCode: string; } /** - * ColumnLongtext + * billingPlan */ - export type ColumnLongtext = { - /** - * Column Key. - */ - key: string; - /** - * Column type. - */ - type: string; - /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` - */ - status: ColumnStatus; + export type BillingPlan = { /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Plan ID. */ - error: string; + $id: string; /** - * Is column required? + * Plan name */ - required: boolean; + name: string; /** - * Is column an array? + * Plan description */ - array?: boolean; + desc: string; /** - * Column creation date in ISO 8601 format. + * Plan order */ - $createdAt: string; + order: number; /** - * Column update date in ISO 8601 format. + * Price */ - $updatedAt: string; + price: number; /** - * Default value for column when not provided. Cannot be set when column is required. + * Trial days */ - default?: string; + trial: number; /** - * Defines whether this column is encrypted or not. + * Bandwidth */ - encrypt?: boolean; - } - - /** - * ColumnMediumtext - */ - export type ColumnMediumtext = { + bandwidth: number; /** - * Column Key. + * Storage */ - key: string; + storage: number; /** - * Column type. + * Image Transformations */ - type: string; + imageTransformations: number; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Screenshots generated */ - status: ColumnStatus; + screenshotsGenerated: number; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Members */ - error: string; + members: number; /** - * Is column required? + * Webhooks */ - required: boolean; + webhooks: number; /** - * Is column an array? + * Projects */ - array?: boolean; + projects: number; /** - * Column creation date in ISO 8601 format. + * Platforms */ - $createdAt: string; + platforms: number; /** - * Column update date in ISO 8601 format. + * Users */ - $updatedAt: string; + users: number; /** - * Default value for column when not provided. Cannot be set when column is required. + * Teams */ - default?: string; + teams: number; /** - * Defines whether this column is encrypted or not. + * Databases */ - encrypt?: boolean; - } - - /** - * ColumnPoint - */ - export type ColumnPoint = { + databases: number; /** - * Column Key. + * Database reads per month */ - key: string; + databasesReads: number; /** - * Column type. + * Database writes per month */ - type: string; + databasesWrites: number; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Database batch size limit */ - status: ColumnStatus; + databasesBatchSize: number; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Buckets */ - error: string; + buckets: number; /** - * Is column required? + * File size */ - required: boolean; + fileSize: number; /** - * Is column an array? + * Functions */ - array?: boolean; + functions: number; /** - * Column creation date in ISO 8601 format. + * Sites */ - $createdAt: string; + sites: number; /** - * Column update date in ISO 8601 format. + * Function executions */ - $updatedAt: string; + executions: number; /** - * Default value for column when not provided. Cannot be set when column is required. + * Rolling max executions retained per function/site */ - default?: any[]; - } - - /** - * ColumnPolygon - */ - export type ColumnPolygon = { + executionsRetentionCount: number; /** - * Column Key. + * GB hours for functions */ - key: string; + GBHours: number; /** - * Column type. + * Realtime connections */ - type: string; + realtime: number; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Realtime messages */ - status: ColumnStatus; + realtimeMessages: number; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Messages per month */ - error: string; + messages: number; /** - * Is column required? + * Topics for messaging */ - required: boolean; + topics: number; /** - * Is column an array? + * SMS authentications per month */ - array?: boolean; + authPhone: number; /** - * Column creation date in ISO 8601 format. + * Custom domains */ - $createdAt: string; + domains: number; /** - * Column update date in ISO 8601 format. + * Log days */ - $updatedAt: string; + logs: number; /** - * Default value for column when not provided. Cannot be set when column is required. + * Number of days of console inactivity before a project is paused. 0 means pausing is disabled. */ - default?: any[]; - } - - /** - * ColumnRelationship - */ - export type ColumnRelationship = { + projectInactivityDays: number; /** - * Column Key. + * Alert threshold percentage */ - key: string; + alertLimit: number; /** - * Column type. + * Additional resources */ - type: string; + usage: UsageBillingPlan; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Addons */ - status: ColumnStatus; + addons: BillingPlanAddon; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Budget cap enabled or disabled. */ - error: string; + budgetCapEnabled: boolean; /** - * Is column required? + * Custom SMTP */ - required: boolean; + customSmtp: boolean; /** - * Is column an array? + * Appwrite branding in email */ - array?: boolean; + emailBranding: boolean; /** - * Column creation date in ISO 8601 format. + * Does plan require payment method */ - $createdAt: string; + requiresPaymentMethod: boolean; /** - * Column update date in ISO 8601 format. + * Does plan require billing address */ - $updatedAt: string; + requiresBillingAddress: boolean; /** - * The ID of the related table. + * Is the billing plan available */ - relatedTable: string; + isAvailable: boolean; /** - * The type of the relationship. + * Can user change the plan themselves */ - relationType: string; + selfService: boolean; /** - * Is the relationship two-way? + * Does plan enable premium support */ - twoWay: boolean; + premiumSupport: boolean; /** - * The key of the two-way relationship. + * Does plan support budget cap */ - twoWayKey: string; + budgeting: boolean; /** - * How deleting the parent document will propagate to child documents. + * Does plan support mock numbers */ - onDelete: string; + supportsMockNumbers: boolean; /** - * Whether this is the parent or child side of the relationship + * Does plan support organization roles */ - side: string; - } - - /** - * ColumnString - */ - export type ColumnString = { + supportsOrganizationRoles: boolean; /** - * Column Key. + * Does plan support credit */ - key: string; + supportsCredits: boolean; /** - * Column type. + * Does plan support backup policies. */ - type: string; + backupsEnabled: boolean; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Whether usage addons are calculated per project. */ - status: ColumnStatus; + usagePerProject: boolean; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * How many policies does plan support */ - error: string; + backupPolicies: number; /** - * Is column required? + * Maximum function and site deployment size in MB */ - required: boolean; + deploymentSize: number; /** - * Is column an array? + * Maximum function and site deployment size in MB */ - array?: boolean; + buildSize: number; /** - * Column creation date in ISO 8601 format. + * Does the plan support encrypted string attributes or not. */ - $createdAt: string; + databasesAllowEncrypt: boolean; /** - * Column update date in ISO 8601 format. + * Plan specific limits */ - $updatedAt: string; + limits?: BillingPlanLimits; /** - * Column size. + * Group of this billing plan for variants */ - size: number; + group: BillingPlanGroup; /** - * Default value for column when not provided. Cannot be set when column is required. + * Details of the program this plan is a part of. */ - default?: string; + program?: Program; + } + + /** + * BillingPlanAddon + */ + export type BillingPlanAddon = { /** - * Defines whether this column is encrypted or not. + * Addon seats */ - encrypt?: boolean; + seats: BillingPlanAddonDetails; + /** + * Addon projects + */ + projects: BillingPlanAddonDetails; } /** - * ColumnText + * BillingPlanAddonDetails */ - export type ColumnText = { + export type BillingPlanAddonDetails = { /** - * Column Key. + * Is the addon supported in the plan? */ - key: string; + supported: boolean; /** - * Column type. + * Addon plan included value */ - type: string; + planIncluded: number; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Addon limit */ - status: ColumnStatus; + limit: number; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Addon type */ - error: string; + type: string; /** - * Is column required? + * Price currency */ - required: boolean; + currency: string; /** - * Is column an array? + * Price */ - array?: boolean; + price: number; /** - * Column creation date in ISO 8601 format. + * Resource value */ - $createdAt: string; + value: number; /** - * Column update date in ISO 8601 format. + * Description on invoice */ - $updatedAt: string; + invoiceDesc: string; + } + + /** + * BillingPlanLimits + */ + export type BillingPlanLimits = { /** - * Default value for column when not provided. Cannot be set when column is required. + * Credits limit per billing cycle */ - default?: string; + credits?: number; /** - * Defines whether this column is encrypted or not. + * Daily credits limit (if applicable) */ - encrypt?: boolean; + dailyCredits?: number; } /** - * ColumnURL + * BillingLimits */ - export type ColumnUrl = { + export type BillingLimits = { /** - * Column Key. + * Bandwidth limit */ - key: string; + bandwidth: number; /** - * Column type. + * Storage limit */ - type: string; + storage: number; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Users limit */ - status: ColumnStatus; + users: number; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Executions limit */ - error: string; + executions: number; /** - * Is column required? + * GBHours limit */ - required: boolean; + GBHours: number; /** - * Is column an array? + * Image transformations limit */ - array?: boolean; + imageTransformations: number; /** - * Column creation date in ISO 8601 format. + * Auth phone limit + */ + authPhone: number; + /** + * Budget limit percentage + */ + budgetLimit: number; + } + + /** + * Block + */ + export type Block = { + /** + * Block creation date in ISO 8601 format. */ $createdAt: string; /** - * Column update date in ISO 8601 format. + * Resource type that is blocked */ - $updatedAt: string; + resourceType: string; /** - * String format. + * Resource identifier that is blocked */ - format: string; + resourceId: string; /** - * Default value for column when not provided. Cannot be set when column is required. + * Reason for the block */ - default?: string; + reason: string; + /** + * Block expiration date in ISO 8601 format. + */ + expiredAt: string; } /** - * ColumnVarchar + * Campaign */ - export type ColumnVarchar = { + export type Campaign = { /** - * Column Key. + * Campaign ID */ - key: string; + $id: string; /** - * Column type. + * Campaign template */ - type: string; + template: string; /** - * Column status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Campaign title */ - status: ColumnStatus; + title: string; /** - * Error message. Displays error generated on failure of creating or deleting an column. + * Campaign description */ - error: string; + description: string; /** - * Is column required? + * Billing plan campaign is associated with */ - required: boolean; + plan?: string; /** - * Is column an array? + * Campaign CTA + */ + cta?: string; + /** + * Campaign info when claimed */ - array?: boolean; + claimed?: string; /** - * Column creation date in ISO 8601 format. + * Campaign infor when unclaimed */ - $createdAt: string; + unclaimed?: string; /** - * Column update date in ISO 8601 format. + * Campaign images */ - $updatedAt: string; + image?: object; /** - * Column size. + * Campaign reviews */ - size: number; + reviews?: Review[]; /** - * Default value for column when not provided. Cannot be set when column is required. + * Campaign valid only for new orgs. */ - default?: string; + onlyNewOrgs?: boolean; /** - * Defines whether this column is encrypted or not. + * Is footer */ - encrypt?: boolean; + footer?: boolean; } /** - * Index + * Program */ - export type ColumnIndex = { + export type Program = { /** - * Index ID. + * Program ID */ $id: string; /** - * Index creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Index update date in ISO 8601 format. + * Program title */ - $updatedAt: string; + title: string; /** - * Index Key. + * Program description */ - key: string; + description: string; /** - * Index type. + * Program tag for highlighting on console */ - type: string; + tag: string; /** - * Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed` + * Program icon for highlighting on console */ - status: string; + icon: string; /** - * Error message. Displays error generated on failure of creating or deleting an index. + * URL for more information on this program */ - error: string; + url: string; /** - * Index columns. + * Whether this program is active */ - columns: string[]; + active: boolean; /** - * Index columns length. + * Whether this program is external */ - lengths: number[]; + external: boolean; /** - * Index orders. + * Billing plan ID that this is program is associated with. */ - orders?: string[]; + billingPlanId: string; } /** - * Rows List + * Coupon */ - export type RowList = { - /** - * Total number of rows that matched your query. - */ - total: number; + export type Coupon = { /** - * List of rows. + * coupon ID */ - rows: Row[]; - } - - /** - * Row - */ - export type Row = { + $id: string; /** - * Row ID. + * coupon ID */ - $id: string; + code: string; /** - * Row sequence ID. + * Provided credit amount */ - $sequence: string; + credits: number; /** - * Table ID. + * Coupon expiration time in ISO 8601 format. */ - $tableId: string; + expiration: string; /** - * Database ID. + * Credit validity in days. */ - $databaseId: string; + validity: number; /** - * Row creation date in ISO 8601 format. + * Campaign the coupon is associated with`. */ - $createdAt: string; + campaign: string; /** - * Row update date in ISO 8601 format. + * Status of the coupon. Can be one of `disabled`, `active` or `expired`. */ - $updatedAt: string; + status: string; /** - * Row permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * If the coupon is only valid for new organizations or not. */ - $permissions: string[]; + onlyNewOrgs: boolean; } - export type DefaultRow = Row & { - [key: string]: any; - [__default]: true; - }; - /** - * UsageTable + * Credit */ - export type UsageTable = { + export type Credit = { /** - * Time range of the usage stats. + * Credit ID. */ - range: string; + $id: string; /** - * Total aggregated number of of rows. + * Credit creation time in ISO 8601 format. */ - rowsTotal: number; + $createdAt: string; /** - * Aggregated number of rows per period. + * Credit update date in ISO 8601 format. */ - rows: Metric[]; - } - - /** - * Teams List - */ - export type TeamList = { + $updatedAt: string; /** - * Total number of teams that matched your query. + * Credit permissions. [Learn more about permissions](/docs/permissions). */ - total: number; + $permissions: string[]; /** - * List of teams. + * coupon ID */ - teams: Team[]; - } - - /** - * Team - */ - export type Team = { + couponId: string; /** - * Team ID. + * ID of the User. */ - $id: string; + userId: string; /** - * Team creation date in ISO 8601 format. + * ID of the Team. */ - $createdAt: string; + teamId: string; /** - * Team update date in ISO 8601 format. + * Provided credit amount */ - $updatedAt: string; + credits: number; /** - * Team name. + * Provided credit amount */ - name: string; + total: number; /** - * Total number of team members. + * Credit expiration time in ISO 8601 format. */ - total: number; + expiration: string; /** - * Team preferences as a key-value object + * Status of the credit. Can be one of `disabled`, `active` or `expired`. */ - prefs: Preferences; + status: string; } /** - * Memberships List + * CreditAvailable */ - export type MembershipList = { - /** - * Total number of memberships that matched your query. - */ - total: number; + export type CreditAvailable = { /** - * List of memberships. + * Total available credits for the organization. */ - memberships: Membership[]; + available: number; } /** - * Membership + * CreditList */ - export type Membership = { - /** - * Membership ID. - */ - $id: string; - /** - * Membership creation date in ISO 8601 format. - */ - $createdAt: string; + export type CreditList = { /** - * Membership update date in ISO 8601 format. + * Credits */ - $updatedAt: string; + credits: Credit[]; /** - * User ID. + * Total number of credits */ - userId: string; + total: number; /** - * User name. Hide this attribute by toggling membership privacy in the Console. + * Total available credit balance in USD */ - userName: string; + available: number; + } + + /** + * Downgrade Feedback + */ + export type DowngradeFeedback = { /** - * User email address. Hide this attribute by toggling membership privacy in the Console. + * Feedback ID. */ - userEmail: string; + $id: string; /** - * Team ID. + * Feedback creation date in ISO 8601 format. */ - teamId: string; + $createdAt: string; /** - * Team name. + * Feedback update date in ISO 8601 format. */ - teamName: string; + $updatedAt: string; /** - * Date, the user has been invited to join the team in ISO 8601 format. + * Feedback reason */ - invited: string; + title: string; /** - * Date, the user has accepted the invitation to join the team in ISO 8601 format. + * Feedback message */ - joined: string; + message: string; /** - * User confirmation status, true if the user has joined the team or false otherwise. + * Plan ID downgrading from */ - confirm: boolean; + fromPlanId: string; /** - * Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console. + * Plan ID downgrading to */ - mfa: boolean; + toPlanId: string; /** - * User list of roles + * Organization ID */ - roles: string[]; - } - - /** - * Resource Tokens List - */ - export type ResourceTokenList = { + teamId: string; /** - * Total number of tokens that matched your query. + * User ID who submitted feedback */ - total: number; + userId: string; /** - * List of tokens. + * Console version */ - tokens: ResourceToken[]; + version: string; } /** - * ResourceToken + * Invoice */ - export type ResourceToken = { + export type Invoice = { /** - * Token ID. + * Invoice ID. */ $id: string; /** - * Token creation date in ISO 8601 format. + * Invoice creation time in ISO 8601 format. */ $createdAt: string; /** - * Resource ID. + * Invoice update date in ISO 8601 format. */ - resourceId: string; + $updatedAt: string; /** - * Resource type. + * Invoice permissions. [Learn more about permissions](/docs/permissions). */ - resourceType: string; + $permissions: string[]; /** - * Token expiration date in ISO 8601 format. + * Project ID */ - expire: string; + teamId: string; /** - * JWT encoded string. + * Aggregation ID */ - secret: string; + aggregationId: string; /** - * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + * Billing plan selected. Can be one of `tier-0`, `tier-1` or `tier-2`. */ - accessedAt: string; - } - - /** - * Users List - */ - export type UserList = { + plan: string; /** - * Total number of users that matched your query. + * Usage breakdown per resource */ - total: number; + usage: UsageResources[]; /** - * List of users. + * Invoice Amount */ - users: User[]; - } - - /** - * UsageUsers - */ - export type UsageUsers = { + amount: number; /** - * Time range of the usage stats. + * Tax percentage */ - range: string; + tax: number; /** - * Total aggregated number of statistics of users. + * Tax amount */ - usersTotal: number; + taxAmount: number; /** - * Total aggregated number of active sessions. + * VAT percentage */ - sessionsTotal: number; + vat: number; /** - * Aggregated number of users per period. + * VAT amount */ - users: Metric[]; + vatAmount: number; /** - * Aggregated number of active sessions per period. + * Gross amount after vat, tax, and discounts applied. */ - sessions: Metric[]; - } - - /** - * DetectionFramework - */ - export type DetectionFramework = { + grossAmount: number; /** - * Environment variables found in .env files + * Credits used. */ - variables?: DetectionVariable[]; + creditsUsed: number; /** - * Framework + * Currency the invoice is in */ - framework: string; + currency: string; /** - * Site Install Command + * Client secret for processing failed payments in front-end */ - installCommand: string; + clientSecret: string; /** - * Site Build Command + * Invoice status */ - buildCommand: string; + status: string; /** - * Site Output Directory + * Last payment error associated with the invoice */ - outputDirectory: string; - } - - /** - * Framework Provider Repositories List - */ - export type ProviderRepositoryFrameworkList = { + lastError: string; /** - * Total number of frameworkProviderRepositories that matched your query. + * Invoice due date. */ - total: number; + dueAt: string; /** - * List of frameworkProviderRepositories. + * Beginning date of the invoice */ - frameworkProviderRepositories: ProviderRepositoryFramework[]; + from: string; + /** + * End date of the invoice + */ + to: string; } /** - * ProviderRepository + * Organization */ - export type ProviderRepository = { - /** - * VCS (Version Control System) repository ID. - */ - id: string; - /** - * VCS (Version Control System) repository name. - */ - name: string; - /** - * VCS (Version Control System) organization name - */ - organization: string; + export type Organization = { /** - * VCS (Version Control System) provider name. + * Team ID. */ - provider: string; + $id: string; /** - * Is VCS (Version Control System) repository private? + * Team creation date in ISO 8601 format. */ - private: boolean; + $createdAt: string; /** - * VCS (Version Control System) repository's default branch name. + * Team update date in ISO 8601 format. */ - defaultBranch: string; + $updatedAt: string; /** - * VCS (Version Control System) installation ID. + * Team name. */ - providerInstallationId: string; + name: string; /** - * Is VCS (Version Control System) repository authorized for the installation? + * Total number of team members. */ - authorized: boolean; + total: number; /** - * Last commit date in ISO 8601 format. + * Team preferences as a key-value object */ - pushedAt: string; + prefs: Preferences; /** - * Environment variables found in .env files + * Project budget limit */ - variables: string[]; - } - - /** - * Branches List - */ - export type BranchList = { + billingBudget: number; /** - * Total number of branches that matched your query. + * Project budget limit */ - total: number; + budgetAlerts: number[]; /** - * List of branches. + * Organization's billing plan ID. */ - branches: Branch[]; - } - - /** - * VCS Content List - */ - export type VcsContentList = { + billingPlan: string; /** - * Total number of contents that matched your query. + * Organization's billing plan ID. */ - total: number; + billingPlanId: string; /** - * List of contents. + * Organization's billing plan. */ - contents: VcsContent[]; - } - - /** - * Installations List - */ - export type InstallationList = { + billingPlanDetails: BillingPlan; /** - * Total number of installations that matched your query. + * Billing email set for the organization. */ - total: number; + billingEmail: string; /** - * List of installations. + * Billing cycle start date. */ - installations: Installation[]; - } - - /** - * Installation - */ - export type Installation = { + billingStartDate: string; /** - * Function ID. + * Current invoice cycle start date. */ - $id: string; + billingCurrentInvoiceDate: string; /** - * Function creation date in ISO 8601 format. + * Next invoice cycle start date. */ - $createdAt: string; + billingNextInvoiceDate: string; /** - * Function update date in ISO 8601 format. + * Start date of trial. */ - $updatedAt: string; + billingTrialStartDate: string; /** - * VCS (Version Control System) provider name. + * Number of trial days. */ - provider: string; + billingTrialDays: number; /** - * VCS (Version Control System) organization name. + * Current active aggregation id. */ - organization: string; + billingAggregationId: string; /** - * VCS (Version Control System) installation ID. + * Current active aggregation id. */ - providerInstallationId: string; - } - - /** - * Webhooks List - */ - export type WebhookList = { + billingInvoiceId: string; /** - * Total number of webhooks that matched your query. + * Default payment method. */ - total: number; + paymentMethodId: string; /** - * List of webhooks. + * Default payment method. */ - webhooks: Webhook[]; - } - - /** - * Webhook - */ - export type Webhook = { + billingAddressId: string; /** - * Webhook ID. + * Backup payment method. */ - $id: string; + backupPaymentMethodId: string; /** - * Webhook creation date in ISO 8601 format. + * Team status. */ - $createdAt: string; + status: string; /** - * Webhook update date in ISO 8601 format. + * Remarks on team status. */ - $updatedAt: string; + remarks: string; /** - * Webhook name. + * Organization agreements */ - name: string; + agreementBAA: string; /** - * Webhook URL endpoint. + * Program manager's name. */ - url: string; + programManagerName: string; /** - * Webhook trigger events. + * Program manager's calendar link. */ - events: string[]; + programManagerCalendar: string; /** - * Indicated if SSL / TLS Certificate verification is enabled. + * Program's discord channel name. */ - security: boolean; + programDiscordChannelName: string; /** - * HTTP basic authentication username. + * Program's discord channel URL. */ - httpUser: string; + programDiscordChannelUrl: string; /** - * HTTP basic authentication password. + * Billing limits reached */ - httpPass: string; + billingLimits: BillingLimits; /** - * Signature key which can be used to validated incoming + * Billing plan selected for downgrade. */ - signatureKey: string; + billingPlanDowngrade: string; /** - * Indicates if this webhook is enabled. + * Tax Id */ - enabled: boolean; + billingTaxId: string; /** - * Webhook error logs from the most recent failure. + * Marked for deletion */ - logs: string; + markedForDeletion: boolean; /** - * Number of consecutive failed webhook attempts. + * Product with which the organization is associated (appwrite or imagine) */ - attempts: number; + platform: string; + /** + * Selected projects + */ + projects: string[]; } /** - * AlgoArgon2 + * PaymentAuthentication */ - export type AlgoArgon2 = { + export type PaymentAuthentication = { /** - * Algo type. + * Message for the end user to show on Console. */ - type: string; + message: string; /** - * Memory used to compute hash. + * Stripe client secret to use for validation. */ - memoryCost: number; + clientSecret: string; /** - * Amount of time consumed to compute hash + * Organization ID for which the payment authentication is needed. */ - timeCost: number; + organizationId: string; /** - * Number of threads used to compute hash. + * Invoice ID against which the payment needs to be validated. */ - threads: number; + invoiceId: string; } /** - * AlgoScrypt + * paymentMethod */ - export type AlgoScrypt = { + export type PaymentMethod = { /** - * Algo type. + * Payment Method ID. */ - type: string; + $id: string; /** - * CPU complexity of computed hash. + * Payment method creation time in ISO 8601 format. */ - costCpu: number; + $createdAt: string; /** - * Memory complexity of computed hash. + * Payment method update date in ISO 8601 format. */ - costMemory: number; + $updatedAt: string; /** - * Parallelization of computed hash. + * Payment method permissions. [Learn more about permissions](/docs/permissions). */ - costParallel: number; + $permissions: string[]; /** - * Length used to compute hash. + * Payment method ID from the payment provider */ - length: number; - } - - /** - * AlgoScryptModified - */ - export type AlgoScryptModified = { + providerMethodId: string; /** - * Algo type. + * Client secret hash for payment setup */ - type: string; + clientSecret: string; /** - * Salt used to compute hash. + * User ID from the payment provider. */ - salt: string; + providerUserId: string; /** - * Separator used to compute hash. + * ID of the Team. */ - saltSeparator: string; + userId: string; /** - * Key used to compute hash. + * Expiry month of the payment method. */ - signerKey: string; - } - - /** - * AlgoBcrypt - */ - export type AlgoBcrypt = { + expiryMonth: number; /** - * Algo type. + * Expiry year of the payment method. */ - type: string; - } - - /** - * AlgoPHPass - */ - export type AlgoPhpass = { + expiryYear: number; /** - * Algo type. + * Last 4 digit of the payment method */ - type: string; - } - - /** - * AlgoSHA - */ - export type AlgoSha = { + last4: string; /** - * Algo type. + * Payment method brand */ - type: string; - } - - /** - * AlgoMD5 - */ - export type AlgoMd5 = { + brand: string; /** - * Algo type. + * Name of the owner */ - type: string; + name: string; + /** + * Mandate ID of the payment method + */ + mandateId: string; + /** + * Country of the payment method + */ + country: string; + /** + * State of the payment method + */ + state: string; + /** + * Last payment error associated with the payment method. + */ + lastError: string; + /** + * True when it's the default payment method. + */ + default: boolean; + /** + * True when payment method has expired. + */ + expired: boolean; + /** + * True when payment method has failed to process multiple times. + */ + failed: boolean; } /** - * Identity + * backup */ - export type Identity = { + export type BackupPolicy = { /** - * Identity ID. + * Backup policy ID. */ $id: string; /** - * Identity creation date in ISO 8601 format. + * Backup policy name. + */ + name: string; + /** + * Policy creation date in ISO 8601 format. */ $createdAt: string; /** - * Identity update date in ISO 8601 format. + * Policy update date in ISO 8601 format. */ $updatedAt: string; /** - * User ID. + * The services that are backed up by this policy. */ - userId: string; + services: string[]; /** - * Identity Provider. + * The resources that are backed up by this policy. */ - provider: string; + resources: string[]; /** - * ID of the User in the Identity Provider. + * The resource ID to backup. Set only if this policy should backup a single resource. */ - providerUid: string; + resourceId?: string; /** - * Email of the User in the Identity Provider. + * The resource type to backup. Set only if this policy should backup a single resource. */ - providerEmail: string; + resourceType?: string; /** - * Identity Provider Access Token. + * How many days to keep the backup before it will be automatically deleted. */ - providerAccessToken: string; + retention: number; /** - * The date of when the access token expires in ISO 8601 format. + * Policy backup schedule in CRON format. */ - providerAccessTokenExpiry: string; + schedule: string; /** - * Identity Provider Refresh Token. + * Is this policy enabled. */ - providerRefreshToken: string; + enabled: boolean; } /** - * Log + * Region */ - export type Log = { - /** - * Event name. - */ - event: string; - /** - * User ID of the actor recorded for this log. During impersonation, this is the original impersonator, not the impersonated target user. - */ - userId: string; - /** - * User email of the actor recorded for this log. During impersonation, this is the original impersonator. - */ - userEmail: string; - /** - * User name of the actor recorded for this log. During impersonation, this is the original impersonator. - */ - userName: string; + export type ConsoleRegion = { /** - * API mode when event triggered. + * Region ID */ - mode: string; + $id: string; /** - * IP session in use when the session was created. + * Region name */ - ip: string; + name: string; /** - * Log creation date in ISO 8601 format. + * Does the organization have access to this region. */ - time: string; + available: boolean; /** - * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). + * Does the backend support this region. */ - osCode: string; + disabled: boolean; /** - * Operating system name. + * Is this the region default. */ - osName: string; + default: boolean; /** - * Operating system version. + * Region flag code. */ - osVersion: string; + flag: string; + } + + /** + * Restoration + */ + export type BackupRestoration = { /** - * Client type. + * Restoration ID. */ - clientType: string; + $id: string; /** - * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). + * Restoration creation time in ISO 8601 format. */ - clientCode: string; + $createdAt: string; /** - * Client name. + * Restoration update date in ISO 8601 format. */ - clientName: string; + $updatedAt: string; /** - * Client version. + * Backup archive ID. */ - clientVersion: string; + archiveId: string; /** - * Client engine name. + * Backup policy ID. */ - clientEngine: string; + policyId: string; /** - * Client engine name. + * The status of the restoration. Possible values: pending, downloading, processing, completed, failed. */ - clientEngineVersion: string; + status: string; /** - * Device name. + * The backup start time. */ - deviceName: string; + startedAt: string; /** - * Device brand name. + * Migration ID. */ - deviceBrand: string; + migrationId: string; /** - * Device model name. + * The services that are backed up by this policy. */ - deviceModel: string; + services: string[]; /** - * Country two-character ISO 3166-1 alpha code. + * The resources that are backed up by this policy. */ - countryCode: string; + resources: string[]; /** - * Country name. + * Optional data in key-value object. */ - countryName: string; + options: string; } /** @@ -8452,467 +8546,363 @@ export namespace Models { } /** - * usageBillingPlan + * Roles */ - export type UsageBillingPlan = { - /** - * Bandwidth additional resources - */ - bandwidth: AdditionalResource; - /** - * Executions additional resources - */ - executions: AdditionalResource; - /** - * Member additional resources - */ - member: AdditionalResource; - /** - * Realtime additional resources - */ - realtime: AdditionalResource; - /** - * Realtime messages additional resources - */ - realtimeMessages: AdditionalResource; - /** - * Realtime bandwidth additional resources - */ - realtimeBandwidth: AdditionalResource; - /** - * Storage additional resources - */ - storage: AdditionalResource; - /** - * User additional resources - */ - users: AdditionalResource; - /** - * GBHour additional resources - */ - GBHours: AdditionalResource; + export type Roles = { /** - * Image transformation additional resources + * Array of scopes accessible to current user. */ - imageTransformations: AdditionalResource; + scopes: string[]; /** - * Credits additional resources + * Array of roles assigned to current user. */ - credits: AdditionalResource; + roles: string[]; } /** - * BillingPlanAddon + * UsageOrganization */ - export type BillingPlanAddon = { + export type UsageOrganization = { /** - * Addon seats + * Aggregated stats for number of requests. */ - seats: BillingPlanAddonDetails; + bandwidth: Metric[]; /** - * Addon projects + * Aggregated stats for consumed bandwidth. */ - projects: BillingPlanAddonDetails; - } - - /** - * BillingPlanLimits - */ - export type BillingPlanLimits = { + users: Metric[]; /** - * Credits limit per billing cycle + * Aggregated stats for function executions. */ - credits?: number; + executions: Metric[]; /** - * Daily credits limit (if applicable) + * Aggregated stats for database reads. */ - dailyCredits?: number; - } - - /** - * BillingLimits - */ - export type BillingLimits = { + databasesReads: Metric[]; /** - * Bandwidth limit + * Aggregated stats for database writes. */ - bandwidth: number; + databasesWrites: Metric[]; /** - * Storage limit + * Aggregated stats for file transformations. */ - storage: number; + imageTransformations: Metric[]; /** - * Users limit + * Aggregated stats for total file transformations. */ - users: number; + imageTransformationsTotal: number; /** - * Executions limit + * Aggregated stats for file transformations. */ - executions: number; + screenshotsGenerated: Metric[]; /** - * GBHours limit + * Aggregated stats for total file transformations. */ - GBHours: number; + screenshotsGeneratedTotal: number; /** - * Image transformations limit + * Aggregated stats for imagine credits. */ - imageTransformations: number; + imagineCredits: Metric[]; /** - * Auth phone limit + * Aggregated stats for total imagine credits. */ - authPhone: number; + imagineCreditsTotal: number; /** - * Budget limit percentage + * Aggregated stats for total users. */ - budgetLimit: number; - } - - /** - * Region - */ - export type ConsoleRegion = { + usersTotal: number; /** - * Region ID + * Aggregated stats for total executions. */ - $id: string; + executionsTotal: number; /** - * Region name + * Aggregated stats for function executions in mb seconds. */ - name: string; + executionsMBSecondsTotal: number; /** - * Does the organization have access to this region. + * Aggregated stats for function builds in mb seconds. */ - available: boolean; + buildsMBSecondsTotal: number; /** - * Does the backend support this region. + * Aggregated stats for total file storage. */ - disabled: boolean; + filesStorageTotal: number; /** - * Is this the region default. + * Aggregated stats for total builds storage. */ - default: boolean; + buildsStorageTotal: number; /** - * Region flag code. + * Aggregated stats for total deployments storage. */ - flag: string; - } - - /** - * Metric - */ - export type Metric = { + deploymentsStorageTotal: number; /** - * The value of this metric at the timestamp. + * Aggregated stats for total databases storage. */ - value: number; + databasesStorageTotal: number; /** - * The date at which this metric was aggregated in ISO 8601 format. + * Aggregated stats for total databases reads. */ - date: string; - } - - /** - * DomainSuggestion - */ - export type DomainSuggestion = { + databasesReadsTotal: number; /** - * Domain suggestion. + * Aggregated stats for total databases writes. */ - domain: string; + databasesWritesTotal: number; /** - * Is the domain premium? + * Aggregated stats for total backups storage. */ - premium: boolean; + backupsStorageTotal: number; /** - * Domain price. + * Aggregated stats for total storage. */ - price?: number; + storageTotal: number; /** - * Is the domain available? + * Aggregated stats for total auth phone. */ - available: boolean; + authPhoneTotal: number; + /** + * Aggregated stats for total auth phone estimation. + */ + authPhoneEstimate: number; + /** + * Aggregated stats for each projects. + */ + projects: UsageOrganizationProject[]; } /** - * Runtime + * UsageOrganizationProject */ - export type Runtime = { + export type UsageOrganizationProject = { /** - * Runtime ID. + * projectId */ - $id: string; + projectId: string; /** - * Parent runtime key. + * Aggregated stats for number of requests. */ - key: string; + bandwidth: Metric[]; /** - * Runtime Name. + * Aggregated stats for consumed bandwidth. */ - name: string; + users: Metric[]; /** - * Runtime version. + * Aggregated stats for function executions. */ - version: string; + executions: number; /** - * Base Docker image used to build the runtime. + * Aggregated stats for database reads. */ - base: string; + databasesReads: Metric[]; /** - * Image name of Docker Hub. + * Aggregated stats for database writes. */ - image: string; + databasesWrites: Metric[]; /** - * Name of the logo image. + * Aggregated stats for function executions in mb seconds. */ - logo: string; + executionsMBSeconds: number; /** - * List of supported architectures. + * Aggregated stats for function builds in mb seconds. */ - supports: string[]; - } - - /** - * Specification - */ - export type Specification = { + buildsMBSeconds: number; /** - * Memory size in MB. + * Aggregated stats for number of documents. */ - memory: number; + storage: number; /** - * Number of CPUs. + * Aggregated stats for phone authentication. */ - cpus: number; + authPhoneTotal: number; /** - * Is size enabled. + * Aggregated stats for phone authentication estimated cost. */ - enabled: boolean; + authPhoneEstimate: number; /** - * Size slug. + * Aggregated stats for total databases reads. */ - slug: string; - } - - /** - * Template Runtime - */ - export type TemplateRuntime = { + databasesReadsTotal: number; /** - * Runtime Name. + * Aggregated stats for total databases writes. */ - name: string; + databasesWritesTotal: number; /** - * The build command used to build the deployment. + * Aggregated stats for file transformations. */ - commands: string; + imageTransformations: Metric[]; /** - * The entrypoint file used to execute the deployment. + * Aggregated stats for total file transformations. */ - entrypoint: string; + imageTransformationsTotal: number; /** - * Path to function in VCS (Version Control System) repository + * Aggregated stats for file transformations. */ - providerRootDirectory: string; - } - - /** - * Template Variable - */ - export type TemplateVariable = { + screenshotsGenerated: Metric[]; /** - * Variable Name. + * Aggregated stats for total file transformations. */ - name: string; + screenshotsGeneratedTotal: number; /** - * Variable Description. + * Aggregated stats for imagine credits. */ - description: string; + imagineCredits: number; + } + + /** + * Domain + */ + export type Domain = { /** - * Variable Value. + * Domain ID. */ - value: string; + $id: string; /** - * Variable secret flag. Secret variables can only be updated or deleted, but never read. + * Domain creation time in ISO 8601 format. */ - secret: boolean; + $createdAt: string; /** - * Variable Placeholder. + * Domain update date in ISO 8601 format. */ - placeholder: string; + $updatedAt: string; /** - * Is the variable required? + * Domain name. */ - required: boolean; + domain: string; /** - * Variable Type. + * Domain registrar (e.g. "appwrite" or "third_party"). */ - type: string; - } - - /** - * Headers - */ - export type Headers = { + registrar: string; /** - * Header name. + * Nameservers setting. "Appwrite" or empty string. */ - name: string; + nameservers: string; /** - * Header value. + * Domain expiry date in ISO 8601 format. */ - value: string; - } - - /** - * LocaleCode - */ - export type LocaleCode = { + expire: string; /** - * Locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) + * Domain renewal date in ISO 8601 format. */ - code: string; + renewal: string; /** - * Locale name + * If set to true, the domain will automatically renew. */ - name: string; - } - - /** - * Continent - */ - export type Continent = { + autoRenewal: boolean; /** - * Continent name. + * Renewal price (in cents). */ - name: string; + renewalPrice: number; /** - * Continent two letter code. + * Transfer status for domains being transferred in. */ - code: string; - } - - /** - * Country - */ - export type Country = { + transferStatus: DomainTransferStatusEnum; /** - * Country name. + * Team ID. */ - name: string; + teamId: string; /** - * Country two-character ISO 3166-1 alpha code. + * Dns records */ - code: string; + dnsRecords: DnsRecord[]; } /** - * Phone + * DomainPurchase */ - export type Phone = { + export type DomainPurchase = { /** - * Phone code. + * Purchase/invoice ID. */ - code: string; + $id: string; /** - * Country two-character ISO 3166-1 alpha code. + * Purchase creation time in ISO 8601 format. */ - countryCode: string; + $createdAt: string; /** - * Country name. + * Purchase update date in ISO 8601 format. */ - countryName: string; - } - - /** - * Currency - */ - export type Currency = { + $updatedAt: string; /** - * Currency symbol. + * Domain document ID. */ - symbol: string; + domainId: string; /** - * Currency name. + * Domain name. */ - name: string; + domain: string; /** - * Currency native symbol. + * Team ID that owns the domain. */ - symbolNative: string; + organizationId: string; /** - * Number of decimal digits. + * Domain purchase status. */ - decimalDigits: number; + status: DomainPurchaseStatus; /** - * Currency digit rounding. + * Stripe client secret for 3DS; empty when not applicable. */ - rounding: number; + clientSecret: string; /** - * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format. + * Purchase amount. */ - code: string; + amount: number; /** - * Currency plural name + * Currency code. */ - namePlural: string; + currency: string; } /** - * Language + * DNSRecord */ - export type Language = { + export type DnsRecord = { /** - * Language name. + * DNS Record ID. */ - name: string; + $id: string; /** - * Language two-character ISO 639-1 codes. + * DNS Record creation time in ISO 8601 format. */ - code: string; + $createdAt: string; /** - * Language native name. + * DNS Record update date in ISO 8601 format. */ - nativeName: string; - } - - /** - * EstimationItem - */ - export type EstimationItem = { + $updatedAt: string; + /** + * DNS record type (e.g. A, CNAME, MX). + */ + type: string; + /** + * Record name or subdomain. + */ + name: string; /** - * Label + * Value of the record (IP address, domain, etc.). */ - label: string; + value: string; /** - * Gross payable amount + * Time to live (in seconds). */ - value: number; - } - - /** - * AggregationBreakdown - */ - export type AggregationBreakdown = { + ttl: number; /** - * Aggregation ID. + * Record priority (commonly used for MX). */ - $id: string; + priority: number; /** - * Project name + * Whether this record is locked (read-only). */ - name: string; + lock: boolean; /** - * Project region + * Record weight (used for SRV records). */ - region: string; + weight: number; /** - * Aggregated amount + * Target port (used for SRV records). */ - amount: number; + port: number; /** - * + * Comment for the DNS record. */ - resources: UsageResources[]; + comment: string; } /** @@ -8946,422 +8936,432 @@ export namespace Models { } /** - * UsageOrganizationProject + * usageBillingPlan */ - export type UsageOrganizationProject = { + export type UsageBillingPlan = { /** - * projectId + * Bandwidth additional resources */ - projectId: string; + bandwidth: AdditionalResource; /** - * Aggregated stats for number of requests. + * Executions additional resources */ - bandwidth: Metric[]; + executions: AdditionalResource; /** - * Aggregated stats for consumed bandwidth. + * Member additional resources */ - users: Metric[]; + member: AdditionalResource; /** - * Aggregated stats for function executions. + * Realtime additional resources */ - executions: number; + realtime: AdditionalResource; /** - * Aggregated stats for database reads. + * Realtime messages additional resources */ - databasesReads: Metric[]; + realtimeMessages: AdditionalResource; /** - * Aggregated stats for database writes. + * Realtime bandwidth additional resources */ - databasesWrites: Metric[]; + realtimeBandwidth: AdditionalResource; /** - * Aggregated stats for function executions in mb seconds. + * Storage additional resources */ - executionsMBSeconds: number; + storage: AdditionalResource; /** - * Aggregated stats for function builds in mb seconds. + * User additional resources */ - buildsMBSeconds: number; + users: AdditionalResource; /** - * Aggregated stats for number of documents. + * GBHour additional resources */ - storage: number; + GBHours: AdditionalResource; /** - * Aggregated stats for phone authentication. + * Image transformation additional resources */ - authPhoneTotal: number; + imageTransformations: AdditionalResource; /** - * Aggregated stats for phone authentication estimated cost. + * Credits additional resources */ - authPhoneEstimate: number; + credits: AdditionalResource; + } + + /** + * Estimation + */ + export type Estimation = { /** - * Aggregated stats for total databases reads. + * Total amount */ - databasesReadsTotal: number; + amount: number; /** - * Aggregated stats for total databases writes. + * Gross payable amount */ - databasesWritesTotal: number; + grossAmount: number; /** - * Aggregated stats for file transformations. + * Discount amount */ - imageTransformations: Metric[]; + discount: number; /** - * Aggregated stats for total file transformations. + * Credits amount */ - imageTransformationsTotal: number; + credits: number; /** - * Aggregated stats for file transformations. + * Estimation items */ - screenshotsGenerated: Metric[]; + items: EstimationItem[]; /** - * Aggregated stats for total file transformations. + * Estimation discount items */ - screenshotsGeneratedTotal: number; + discounts: EstimationItem[]; /** - * Aggregated stats for imagine credits. + * Trial days */ - imagineCredits: number; + trialDays: number; + /** + * Trial end date + */ + trialEndDate?: string; } /** - * Metric Breakdown + * EstimationUpdatePlan */ - export type MetricBreakdown = { - /** - * Resource ID. - */ - resourceId?: string; - /** - * Resource name. - */ - name: string; + export type EstimationUpdatePlan = { /** - * The value of this metric at the timestamp. + * Total amount */ - value: number; + amount: number; /** - * The estimated value of this metric at the end of the period. + * Gross payable amount */ - estimate?: number; - } - - /** - * Mock Number - */ - export type MockNumber = { + grossAmount: number; /** - * Mock phone number for testing phone authentication. Useful for testing phone authentication without sending an SMS. + * Discount amount */ - phone: string; + discount: number; /** - * Mock OTP for the number. + * Credits amount */ - otp: string; - } - - /** - * AuthProvider - */ - export type AuthProvider = { + credits: number; /** - * Auth Provider. + * Estimation items */ - key: string; + items: EstimationItem[]; /** - * Auth Provider name. + * Estimation discount items */ - name: string; + discounts: EstimationItem[]; /** - * OAuth 2.0 application ID. + * Trial days */ - appId: string; + trialDays: number; /** - * OAuth 2.0 application secret. Might be JSON string if provider requires extra configuration. + * Trial end date */ - secret: string; + trialEndDate?: string; /** - * Auth Provider is active and can be used to create session. + * Organization's existing credits */ - enabled: boolean; + organizationCredits: number; } /** - * Block + * EstimationDeleteOrganization */ - export type Block = { - /** - * Block creation date in ISO 8601 format. - */ - $createdAt: string; - /** - * Resource type that is blocked - */ - resourceType: string; - /** - * Resource identifier that is blocked - */ - resourceId: string; - /** - * Reason for the block - */ - reason: string; + export type EstimationDeleteOrganization = { /** - * Block expiration date in ISO 8601 format. + * List of unpaid invoices */ - expiredAt: string; + unpaidInvoices: Invoice[]; } /** - * Framework + * EstimationItem */ - export type Framework = { - /** - * Framework key. - */ - key: string; - /** - * Framework Name. - */ - name: string; - /** - * Default runtime version. - */ - buildRuntime: string; + export type EstimationItem = { /** - * List of supported runtime versions. + * Label */ - runtimes: string[]; + label: string; /** - * List of supported adapters. + * Gross payable amount */ - adapters: FrameworkAdapter[]; + value: number; } /** - * Template Framework + * DomainPrice */ - export type TemplateFramework = { - /** - * Parent framework key. - */ - key: string; - /** - * Framework Name. - */ - name: string; - /** - * The install command used to install the dependencies. - */ - installCommand: string; + export type DomainPrice = { /** - * The build command used to build the deployment. + * Domain name. */ - buildCommand: string; + domain: string; /** - * The output directory to store the build output. + * Top-level domain for the requested domain. */ - outputDirectory: string; + tld: string; /** - * Path to site in VCS (Version Control System) repository + * Whether the domain is currently available for registration. */ - providerRootDirectory: string; + available: boolean; /** - * Runtime used during build step of template. + * Domain registration price. */ - buildRuntime: string; + price: number; /** - * Site framework runtime + * Price period in years. */ - adapter: string; + periodYears: number; /** - * Fallback file for SPA. Only relevant for static serve runtime. + * Whether the domain is a premium domain. */ - fallbackFile: string; + premium: boolean; } /** - * DetectionVariable + * DomainSuggestion */ - export type DetectionVariable = { + export type DomainSuggestion = { /** - * Name of environment variable + * Domain suggestion. */ - name: string; + domain: string; /** - * Value of environment variable + * Is the domain premium? */ - value: string; + premium: boolean; + /** + * Domain price. + */ + price?: number; + /** + * Is the domain available? + */ + available: boolean; } /** - * ProviderRepositoryFramework + * domainTransferOut */ - export type ProviderRepositoryFramework = { - /** - * VCS (Version Control System) repository ID. - */ - id: string; + export type DomainTransferOut = { /** - * VCS (Version Control System) repository name. + * Domain transfer authorization code. */ - name: string; + authCode: string; + } + + /** + * domainTransferStatus + */ + export type DomainTransferStatus = { /** - * VCS (Version Control System) organization name + * Transfer status. */ - organization: string; + status: DomainTransferStatusEnum; /** - * VCS (Version Control System) provider name. + * Additional transfer status information. */ - provider: string; + reason: string; /** - * Is VCS (Version Control System) repository private? + * Transfer status timestamp in ISO 8601 format. */ - private: boolean; + timestamp: string; + } + + /** + * Activity event list + */ + export type ActivityEventList = { /** - * VCS (Version Control System) repository's default branch name. + * Total number of events that matched your query. */ - defaultBranch: string; + total: number; /** - * VCS (Version Control System) installation ID. + * List of events. */ - providerInstallationId: string; + events: ActivityEvent[]; + } + + /** + * Aggregation team list + */ + export type AggregationTeamList = { /** - * Is VCS (Version Control System) repository authorized for the installation? + * Total number of aggregations that matched your query. */ - authorized: boolean; + total: number; /** - * Last commit date in ISO 8601 format. + * List of aggregations. */ - pushedAt: string; + aggregations: AggregationTeam[]; + } + + /** + * Backup archive list + */ + export type BackupArchiveList = { /** - * Environment variables found in .env files + * Total number of archives that matched your query. */ - variables: string[]; + total: number; /** - * Auto-detected framework. Empty if type is not "framework". + * List of archives. */ - framework: string; + archives: BackupArchive[]; } /** - * Branch + * Backup policy list */ - export type Branch = { + export type BackupPolicyList = { /** - * Branch Name. + * Total number of policies that matched your query. */ - name: string; + total: number; + /** + * List of policies. + */ + policies: BackupPolicy[]; } /** - * VcsContents + * Backup restoration list */ - export type VcsContent = { - /** - * Content size in bytes. Only files have size, and for directories, 0 is returned. - */ - size?: number; + export type BackupRestorationList = { /** - * If a content is a directory. Directories can be used to check nested contents. + * Total number of restorations that matched your query. */ - isDirectory?: boolean; + total: number; /** - * Name of directory or file. + * List of restorations. */ - name: string; + restorations: BackupRestoration[]; } /** - * AdditionalResource + * Billing invoices list */ - export type AdditionalResource = { + export type InvoiceList = { /** - * Resource name + * Total number of invoices that matched your query. */ - name: string; + total: number; /** - * Resource unit + * List of invoices. */ - unit: string; + invoices: Invoice[]; + } + + /** + * Billing address list + */ + export type BillingAddressList = { /** - * Price currency + * Total number of billingAddresses that matched your query. */ - currency: string; + total: number; /** - * Price + * List of billingAddresses. */ - price: number; + billingAddresses: BillingAddress[]; + } + + /** + * Billing plan list + */ + export type BillingPlanList = { /** - * Resource value + * Total number of plans that matched your query. */ - value: number; + total: number; /** - * Description on invoice + * List of plans. */ - invoiceDesc: string; + plans: BillingPlan[]; } /** - * BillingPlanAddonDetails + * Organizations list */ - export type BillingPlanAddonDetails = { + export type OrganizationList = { /** - * Is the addon supported in the plan? + * Total number of teams that matched your query. */ - supported: boolean; + total: number; /** - * Addon plan included value + * List of teams. */ - planIncluded: number; + teams: Organization[]; + } + + /** + * Payment methods list + */ + export type PaymentMethodList = { /** - * Addon limit + * Total number of paymentMethods that matched your query. */ - limit: number; + total: number; /** - * Addon type + * List of paymentMethods. */ - type: string; + paymentMethods: PaymentMethod[]; + } + + /** + * Regions list + */ + export type ConsoleRegionList = { /** - * Price currency + * Total number of regions that matched your query. */ - currency: string; + total: number; /** - * Price + * List of regions. */ - price: number; + regions: ConsoleRegion[]; + } + + /** + * Domains list + */ + export type DomainsList = { /** - * Resource value + * Total number of domains that matched your query. */ - value: number; + total: number; /** - * Description on invoice + * List of domains. */ - invoiceDesc: string; + domains: Domain[]; } /** - * Framework Adapter + * DNS records list */ - export type FrameworkAdapter = { - /** - * Adapter key. - */ - key: string; + export type DnsRecordsList = { /** - * Default command to download dependencies. + * Total number of dnsRecords that matched your query. */ - installCommand: string; + total: number; /** - * Default command to build site into output directory. + * List of dnsRecords. */ - buildCommand: string; + dnsRecords: DnsRecord[]; + } + + /** + * Domain suggestions list + */ + export type DomainSuggestionsList = { /** - * Default output directory of build. + * Total number of suggestions that matched your query. */ - outputDirectory: string; + total: number; /** - * Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. + * List of suggestions. */ - fallbackFile: string; + suggestions: DomainSuggestion[]; } } From 5a4ed725e188edd33778e46e1a49d32258e70b5c Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Mar 2026 07:08:31 +0000 Subject: [PATCH 6/9] chore: update Console SDK to 7.0.0 --- src/enums/scopes.ts | 76 +++++++++++++++++++++++++++++++++ src/enums/use-cases.ts | 7 +++ src/enums/vcs-reference-type.ts | 1 + 3 files changed, 84 insertions(+) diff --git a/src/enums/scopes.ts b/src/enums/scopes.ts index a30e13ea..8287d582 100644 --- a/src/enums/scopes.ts +++ b/src/enums/scopes.ts @@ -2,4 +2,80 @@ export enum Scopes { Account = 'account', TeamsRead = 'teams.read', TeamsWrite = 'teams.write', + SessionsWrite = 'sessions.write', + UsersRead = 'users.read', + UsersWrite = 'users.write', + DatabasesRead = 'databases.read', + DatabasesWrite = 'databases.write', + CollectionsRead = 'collections.read', + CollectionsWrite = 'collections.write', + TablesRead = 'tables.read', + TablesWrite = 'tables.write', + AttributesRead = 'attributes.read', + AttributesWrite = 'attributes.write', + ColumnsRead = 'columns.read', + ColumnsWrite = 'columns.write', + IndexesRead = 'indexes.read', + IndexesWrite = 'indexes.write', + DocumentsRead = 'documents.read', + DocumentsWrite = 'documents.write', + RowsRead = 'rows.read', + RowsWrite = 'rows.write', + FilesRead = 'files.read', + FilesWrite = 'files.write', + BucketsRead = 'buckets.read', + BucketsWrite = 'buckets.write', + FunctionsRead = 'functions.read', + FunctionsWrite = 'functions.write', + SitesRead = 'sites.read', + SitesWrite = 'sites.write', + LogRead = 'log.read', + LogWrite = 'log.write', + ExecutionRead = 'execution.read', + ExecutionWrite = 'execution.write', + LocaleRead = 'locale.read', + AvatarsRead = 'avatars.read', + HealthRead = 'health.read', + ProvidersRead = 'providers.read', + ProvidersWrite = 'providers.write', + MessagesRead = 'messages.read', + MessagesWrite = 'messages.write', + TopicsRead = 'topics.read', + TopicsWrite = 'topics.write', + SubscribersRead = 'subscribers.read', + SubscribersWrite = 'subscribers.write', + TargetsRead = 'targets.read', + TargetsWrite = 'targets.write', + RulesRead = 'rules.read', + RulesWrite = 'rules.write', + SchedulesRead = 'schedules.read', + SchedulesWrite = 'schedules.write', + MigrationsRead = 'migrations.read', + MigrationsWrite = 'migrations.write', + VcsRead = 'vcs.read', + VcsWrite = 'vcs.write', + AssistantRead = 'assistant.read', + TokensRead = 'tokens.read', + TokensWrite = 'tokens.write', + WebhooksRead = 'webhooks.read', + WebhooksWrite = 'webhooks.write', + ProjectRead = 'project.read', + ProjectWrite = 'project.write', + PoliciesWrite = 'policies.write', + PoliciesRead = 'policies.read', + ArchivesRead = 'archives.read', + ArchivesWrite = 'archives.write', + RestorationsRead = 'restorations.read', + RestorationsWrite = 'restorations.write', + DomainsRead = 'domains.read', + DomainsWrite = 'domains.write', + EventsRead = 'events.read', + PlatformsRead = 'platforms.read', + PlatformsWrite = 'platforms.write', + ProjectsRead = 'projects.read', + ProjectsWrite = 'projects.write', + KeysRead = 'keys.read', + KeysWrite = 'keys.write', + DevKeysRead = 'devKeys.read', + DevKeysWrite = 'devKeys.write', } \ No newline at end of file diff --git a/src/enums/use-cases.ts b/src/enums/use-cases.ts index e0a485cd..d8e7306c 100644 --- a/src/enums/use-cases.ts +++ b/src/enums/use-cases.ts @@ -6,4 +6,11 @@ export enum UseCases { Utilities = 'utilities', Devtools = 'dev-tools', Auth = 'auth', + Portfolio = 'portfolio', + Events = 'events', + Ecommerce = 'ecommerce', + Documentation = 'documentation', + Blog = 'blog', + Forms = 'forms', + Dashboard = 'dashboard', } \ No newline at end of file diff --git a/src/enums/vcs-reference-type.ts b/src/enums/vcs-reference-type.ts index 5bbae171..cb5270f5 100644 --- a/src/enums/vcs-reference-type.ts +++ b/src/enums/vcs-reference-type.ts @@ -1,4 +1,5 @@ export enum VCSReferenceType { Branch = 'branch', Commit = 'commit', + Tag = 'tag', } \ No newline at end of file From 98df9f9faaf446e697f84beee9a9f7f173d8a5fd Mon Sep 17 00:00:00 2001 From: root Date: Thu, 26 Mar 2026 04:16:21 +0000 Subject: [PATCH 7/9] chore: update Console SDK to 7.0.0 --- docs/examples/domains/create-purchase.md | 3 +- docs/examples/domains/create-transfer-in.md | 3 +- docs/examples/domains/update-auto-renewal.md | 16 +++ src/enums/build-runtime.ts | 86 --------------- src/enums/runtime.ts | 86 --------------- src/enums/runtimes.ts | 86 --------------- src/services/domains.ts | 105 ++++++++++++++++--- 7 files changed, 111 insertions(+), 274 deletions(-) create mode 100644 docs/examples/domains/update-auto-renewal.md diff --git a/docs/examples/domains/create-purchase.md b/docs/examples/domains/create-purchase.md index ab33c5e8..0e13e044 100644 --- a/docs/examples/domains/create-purchase.md +++ b/docs/examples/domains/create-purchase.md @@ -18,7 +18,8 @@ const result = await domains.createPurchase({ paymentMethodId: '', addressLine3: '', // optional companyName: '', // optional - periodYears: 1 // optional + periodYears: 1, // optional + autoRenewal: false // optional }); console.log(result); diff --git a/docs/examples/domains/create-transfer-in.md b/docs/examples/domains/create-transfer-in.md index f26fa0c3..a5705d04 100644 --- a/docs/examples/domains/create-transfer-in.md +++ b/docs/examples/domains/create-transfer-in.md @@ -11,7 +11,8 @@ const result = await domains.createTransferIn({ domain: '', organizationId: '', authCode: '', - paymentMethodId: '' + paymentMethodId: '', + autoRenewal: false // optional }); console.log(result); diff --git a/docs/examples/domains/update-auto-renewal.md b/docs/examples/domains/update-auto-renewal.md new file mode 100644 index 00000000..48512c06 --- /dev/null +++ b/docs/examples/domains/update-auto-renewal.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Domains } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const domains = new Domains(client); + +const result = await domains.updateAutoRenewal({ + domainId: '', + autoRenewal: false +}); + +console.log(result); +``` diff --git a/src/enums/build-runtime.ts b/src/enums/build-runtime.ts index be56a9f4..3f85913f 100644 --- a/src/enums/build-runtime.ts +++ b/src/enums/build-runtime.ts @@ -85,90 +85,4 @@ export enum BuildRuntime { Flutter332 = 'flutter-3.32', Flutter335 = 'flutter-3.35', Flutter338 = 'flutter-3.38', - Node145rc = 'node-14.5-rc', - Node160rc = 'node-16.0-rc', - Node180rc = 'node-18.0-rc', - Node190rc = 'node-19.0-rc', - Node200rc = 'node-20.0-rc', - Node210rc = 'node-21.0-rc', - Node22rc = 'node-22-rc', - Node23rc = 'node-23-rc', - Node24rc = 'node-24-rc', - Node25rc = 'node-25-rc', - Php80rc = 'php-8.0-rc', - Php81rc = 'php-8.1-rc', - Php82rc = 'php-8.2-rc', - Php83rc = 'php-8.3-rc', - Php84rc = 'php-8.4-rc', - Ruby30rc = 'ruby-3.0-rc', - Ruby31rc = 'ruby-3.1-rc', - Ruby32rc = 'ruby-3.2-rc', - Ruby33rc = 'ruby-3.3-rc', - Ruby34rc = 'ruby-3.4-rc', - Ruby40rc = 'ruby-4.0-rc', - Python38rc = 'python-3.8-rc', - Python39rc = 'python-3.9-rc', - Python310rc = 'python-3.10-rc', - Python311rc = 'python-3.11-rc', - Python312rc = 'python-3.12-rc', - Python313rc = 'python-3.13-rc', - Python314rc = 'python-3.14-rc', - Pythonml311rc = 'python-ml-3.11-rc', - Pythonml312rc = 'python-ml-3.12-rc', - Pythonml313rc = 'python-ml-3.13-rc', - Deno140rc = 'deno-1.40-rc', - Deno146rc = 'deno-1.46-rc', - Deno20rc = 'deno-2.0-rc', - Deno25rc = 'deno-2.5-rc', - Deno26rc = 'deno-2.6-rc', - Dart215rc = 'dart-2.15-rc', - Dart216rc = 'dart-2.16-rc', - Dart217rc = 'dart-2.17-rc', - Dart218rc = 'dart-2.18-rc', - Dart219rc = 'dart-2.19-rc', - Dart30rc = 'dart-3.0-rc', - Dart31rc = 'dart-3.1-rc', - Dart33rc = 'dart-3.3-rc', - Dart35rc = 'dart-3.5-rc', - Dart38rc = 'dart-3.8-rc', - Dart39rc = 'dart-3.9-rc', - Dart310rc = 'dart-3.10-rc', - Dotnet60rc = 'dotnet-6.0-rc', - Dotnet70rc = 'dotnet-7.0-rc', - Dotnet80rc = 'dotnet-8.0-rc', - Dotnet10rc = 'dotnet-10-rc', - Java80rc = 'java-8.0-rc', - Java110rc = 'java-11.0-rc', - Java170rc = 'java-17.0-rc', - Java180rc = 'java-18.0-rc', - Java210rc = 'java-21.0-rc', - Java22rc = 'java-22-rc', - Java25rc = 'java-25-rc', - Swift55rc = 'swift-5.5-rc', - Swift58rc = 'swift-5.8-rc', - Swift59rc = 'swift-5.9-rc', - Swift510rc = 'swift-5.10-rc', - Swift62rc = 'swift-6.2-rc', - Kotlin16rc = 'kotlin-1.6-rc', - Kotlin18rc = 'kotlin-1.8-rc', - Kotlin19rc = 'kotlin-1.9-rc', - Kotlin20rc = 'kotlin-2.0-rc', - Kotlin23rc = 'kotlin-2.3-rc', - Cpp17rc = 'cpp-17-rc', - Cpp20rc = 'cpp-20-rc', - Bun10rc = 'bun-1.0-rc', - Bun11rc = 'bun-1.1-rc', - Bun12rc = 'bun-1.2-rc', - Bun13rc = 'bun-1.3-rc', - Go123rc = 'go-1.23-rc', - Go124rc = 'go-1.24-rc', - Go125rc = 'go-1.25-rc', - Go126rc = 'go-1.26-rc', - Static1rc = 'static-1-rc', - Flutter324rc = 'flutter-3.24-rc', - Flutter327rc = 'flutter-3.27-rc', - Flutter329rc = 'flutter-3.29-rc', - Flutter332rc = 'flutter-3.32-rc', - Flutter335rc = 'flutter-3.35-rc', - Flutter338rc = 'flutter-3.38-rc', } \ No newline at end of file diff --git a/src/enums/runtime.ts b/src/enums/runtime.ts index cfd4a735..fda3bab3 100644 --- a/src/enums/runtime.ts +++ b/src/enums/runtime.ts @@ -85,90 +85,4 @@ export enum Runtime { Flutter332 = 'flutter-3.32', Flutter335 = 'flutter-3.35', Flutter338 = 'flutter-3.38', - Node145rc = 'node-14.5-rc', - Node160rc = 'node-16.0-rc', - Node180rc = 'node-18.0-rc', - Node190rc = 'node-19.0-rc', - Node200rc = 'node-20.0-rc', - Node210rc = 'node-21.0-rc', - Node22rc = 'node-22-rc', - Node23rc = 'node-23-rc', - Node24rc = 'node-24-rc', - Node25rc = 'node-25-rc', - Php80rc = 'php-8.0-rc', - Php81rc = 'php-8.1-rc', - Php82rc = 'php-8.2-rc', - Php83rc = 'php-8.3-rc', - Php84rc = 'php-8.4-rc', - Ruby30rc = 'ruby-3.0-rc', - Ruby31rc = 'ruby-3.1-rc', - Ruby32rc = 'ruby-3.2-rc', - Ruby33rc = 'ruby-3.3-rc', - Ruby34rc = 'ruby-3.4-rc', - Ruby40rc = 'ruby-4.0-rc', - Python38rc = 'python-3.8-rc', - Python39rc = 'python-3.9-rc', - Python310rc = 'python-3.10-rc', - Python311rc = 'python-3.11-rc', - Python312rc = 'python-3.12-rc', - Python313rc = 'python-3.13-rc', - Python314rc = 'python-3.14-rc', - Pythonml311rc = 'python-ml-3.11-rc', - Pythonml312rc = 'python-ml-3.12-rc', - Pythonml313rc = 'python-ml-3.13-rc', - Deno140rc = 'deno-1.40-rc', - Deno146rc = 'deno-1.46-rc', - Deno20rc = 'deno-2.0-rc', - Deno25rc = 'deno-2.5-rc', - Deno26rc = 'deno-2.6-rc', - Dart215rc = 'dart-2.15-rc', - Dart216rc = 'dart-2.16-rc', - Dart217rc = 'dart-2.17-rc', - Dart218rc = 'dart-2.18-rc', - Dart219rc = 'dart-2.19-rc', - Dart30rc = 'dart-3.0-rc', - Dart31rc = 'dart-3.1-rc', - Dart33rc = 'dart-3.3-rc', - Dart35rc = 'dart-3.5-rc', - Dart38rc = 'dart-3.8-rc', - Dart39rc = 'dart-3.9-rc', - Dart310rc = 'dart-3.10-rc', - Dotnet60rc = 'dotnet-6.0-rc', - Dotnet70rc = 'dotnet-7.0-rc', - Dotnet80rc = 'dotnet-8.0-rc', - Dotnet10rc = 'dotnet-10-rc', - Java80rc = 'java-8.0-rc', - Java110rc = 'java-11.0-rc', - Java170rc = 'java-17.0-rc', - Java180rc = 'java-18.0-rc', - Java210rc = 'java-21.0-rc', - Java22rc = 'java-22-rc', - Java25rc = 'java-25-rc', - Swift55rc = 'swift-5.5-rc', - Swift58rc = 'swift-5.8-rc', - Swift59rc = 'swift-5.9-rc', - Swift510rc = 'swift-5.10-rc', - Swift62rc = 'swift-6.2-rc', - Kotlin16rc = 'kotlin-1.6-rc', - Kotlin18rc = 'kotlin-1.8-rc', - Kotlin19rc = 'kotlin-1.9-rc', - Kotlin20rc = 'kotlin-2.0-rc', - Kotlin23rc = 'kotlin-2.3-rc', - Cpp17rc = 'cpp-17-rc', - Cpp20rc = 'cpp-20-rc', - Bun10rc = 'bun-1.0-rc', - Bun11rc = 'bun-1.1-rc', - Bun12rc = 'bun-1.2-rc', - Bun13rc = 'bun-1.3-rc', - Go123rc = 'go-1.23-rc', - Go124rc = 'go-1.24-rc', - Go125rc = 'go-1.25-rc', - Go126rc = 'go-1.26-rc', - Static1rc = 'static-1-rc', - Flutter324rc = 'flutter-3.24-rc', - Flutter327rc = 'flutter-3.27-rc', - Flutter329rc = 'flutter-3.29-rc', - Flutter332rc = 'flutter-3.32-rc', - Flutter335rc = 'flutter-3.35-rc', - Flutter338rc = 'flutter-3.38-rc', } \ No newline at end of file diff --git a/src/enums/runtimes.ts b/src/enums/runtimes.ts index 5b1deeac..546822bf 100644 --- a/src/enums/runtimes.ts +++ b/src/enums/runtimes.ts @@ -85,90 +85,4 @@ export enum Runtimes { Flutter332 = 'flutter-3.32', Flutter335 = 'flutter-3.35', Flutter338 = 'flutter-3.38', - Node145rc = 'node-14.5-rc', - Node160rc = 'node-16.0-rc', - Node180rc = 'node-18.0-rc', - Node190rc = 'node-19.0-rc', - Node200rc = 'node-20.0-rc', - Node210rc = 'node-21.0-rc', - Node22rc = 'node-22-rc', - Node23rc = 'node-23-rc', - Node24rc = 'node-24-rc', - Node25rc = 'node-25-rc', - Php80rc = 'php-8.0-rc', - Php81rc = 'php-8.1-rc', - Php82rc = 'php-8.2-rc', - Php83rc = 'php-8.3-rc', - Php84rc = 'php-8.4-rc', - Ruby30rc = 'ruby-3.0-rc', - Ruby31rc = 'ruby-3.1-rc', - Ruby32rc = 'ruby-3.2-rc', - Ruby33rc = 'ruby-3.3-rc', - Ruby34rc = 'ruby-3.4-rc', - Ruby40rc = 'ruby-4.0-rc', - Python38rc = 'python-3.8-rc', - Python39rc = 'python-3.9-rc', - Python310rc = 'python-3.10-rc', - Python311rc = 'python-3.11-rc', - Python312rc = 'python-3.12-rc', - Python313rc = 'python-3.13-rc', - Python314rc = 'python-3.14-rc', - Pythonml311rc = 'python-ml-3.11-rc', - Pythonml312rc = 'python-ml-3.12-rc', - Pythonml313rc = 'python-ml-3.13-rc', - Deno140rc = 'deno-1.40-rc', - Deno146rc = 'deno-1.46-rc', - Deno20rc = 'deno-2.0-rc', - Deno25rc = 'deno-2.5-rc', - Deno26rc = 'deno-2.6-rc', - Dart215rc = 'dart-2.15-rc', - Dart216rc = 'dart-2.16-rc', - Dart217rc = 'dart-2.17-rc', - Dart218rc = 'dart-2.18-rc', - Dart219rc = 'dart-2.19-rc', - Dart30rc = 'dart-3.0-rc', - Dart31rc = 'dart-3.1-rc', - Dart33rc = 'dart-3.3-rc', - Dart35rc = 'dart-3.5-rc', - Dart38rc = 'dart-3.8-rc', - Dart39rc = 'dart-3.9-rc', - Dart310rc = 'dart-3.10-rc', - Dotnet60rc = 'dotnet-6.0-rc', - Dotnet70rc = 'dotnet-7.0-rc', - Dotnet80rc = 'dotnet-8.0-rc', - Dotnet10rc = 'dotnet-10-rc', - Java80rc = 'java-8.0-rc', - Java110rc = 'java-11.0-rc', - Java170rc = 'java-17.0-rc', - Java180rc = 'java-18.0-rc', - Java210rc = 'java-21.0-rc', - Java22rc = 'java-22-rc', - Java25rc = 'java-25-rc', - Swift55rc = 'swift-5.5-rc', - Swift58rc = 'swift-5.8-rc', - Swift59rc = 'swift-5.9-rc', - Swift510rc = 'swift-5.10-rc', - Swift62rc = 'swift-6.2-rc', - Kotlin16rc = 'kotlin-1.6-rc', - Kotlin18rc = 'kotlin-1.8-rc', - Kotlin19rc = 'kotlin-1.9-rc', - Kotlin20rc = 'kotlin-2.0-rc', - Kotlin23rc = 'kotlin-2.3-rc', - Cpp17rc = 'cpp-17-rc', - Cpp20rc = 'cpp-20-rc', - Bun10rc = 'bun-1.0-rc', - Bun11rc = 'bun-1.1-rc', - Bun12rc = 'bun-1.2-rc', - Bun13rc = 'bun-1.3-rc', - Go123rc = 'go-1.23-rc', - Go124rc = 'go-1.24-rc', - Go125rc = 'go-1.25-rc', - Go126rc = 'go-1.26-rc', - Static1rc = 'static-1-rc', - Flutter324rc = 'flutter-3.24-rc', - Flutter327rc = 'flutter-3.27-rc', - Flutter329rc = 'flutter-3.29-rc', - Flutter332rc = 'flutter-3.32-rc', - Flutter335rc = 'flutter-3.35-rc', - Flutter338rc = 'flutter-3.38-rc', } \ No newline at end of file diff --git a/src/services/domains.ts b/src/services/domains.ts index 4d259420..6277582f 100644 --- a/src/services/domains.ts +++ b/src/services/domains.ts @@ -220,10 +220,11 @@ export class Domains { * @param {string} params.addressLine3 - Additional address line for the registrant (line 3). * @param {string} params.companyName - Company or organization name for the registrant. * @param {number} params.periodYears - Registration term in years (1-10). + * @param {boolean} params.autoRenewal - Whether the domain should renew automatically after purchase. * @throws {AppwriteException} * @returns {Promise} */ - createPurchase(params: { domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number }): Promise; + createPurchase(params: { domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number, autoRenewal?: boolean }): Promise; /** * Initiate a domain purchase by providing registrant details and a payment method. Authorizes the payment and returns a `clientSecret`. If 3D Secure is required, use the `clientSecret` on the client to complete the authentication challenge. Once authentication is complete (or if none is needed), call the Update Purchase endpoint to capture the payment and finalize the purchase. * @@ -238,19 +239,20 @@ export class Domains { * @param {string} addressLine3 - Additional address line for the registrant (line 3). * @param {string} companyName - Company or organization name for the registrant. * @param {number} periodYears - Registration term in years (1-10). + * @param {boolean} autoRenewal - Whether the domain should renew automatically after purchase. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createPurchase(domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number): Promise; + createPurchase(domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number, autoRenewal?: boolean): Promise; createPurchase( - paramsOrFirst: { domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number } | string, - ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?] + paramsOrFirst: { domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number, autoRenewal?: boolean } | string, + ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (boolean)?] ): Promise { - let params: { domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number }; + let params: { domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number, autoRenewal?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number }; + params = (paramsOrFirst || {}) as { domain: string, organizationId: string, firstName: string, lastName: string, email: string, phone: string, billingAddressId: string, paymentMethodId: string, addressLine3?: string, companyName?: string, periodYears?: number, autoRenewal?: boolean }; } else { params = { domain: paramsOrFirst as string, @@ -263,7 +265,8 @@ export class Domains { paymentMethodId: rest[6] as string, addressLine3: rest[7] as string, companyName: rest[8] as string, - periodYears: rest[9] as number + periodYears: rest[9] as number, + autoRenewal: rest[10] as boolean }; } @@ -278,6 +281,7 @@ export class Domains { const addressLine3 = params.addressLine3; const companyName = params.companyName; const periodYears = params.periodYears; + const autoRenewal = params.autoRenewal; if (typeof domain === 'undefined') { throw new AppwriteException('Missing required parameter: "domain"'); @@ -336,6 +340,9 @@ export class Domains { if (typeof periodYears !== 'undefined') { payload['periodYears'] = periodYears; } + if (typeof autoRenewal !== 'undefined') { + payload['autoRenewal'] = autoRenewal; + } if (typeof paymentMethodId !== 'undefined') { payload['paymentMethodId'] = paymentMethodId; } @@ -513,10 +520,11 @@ export class Domains { * @param {string} params.organizationId - Organization ID that this domain will belong to. * @param {string} params.authCode - Authorization code for the domain transfer. * @param {string} params.paymentMethodId - Payment method ID to authorize and capture the transfer. + * @param {boolean} params.autoRenewal - Whether the domain should renew automatically after transfer. * @throws {AppwriteException} * @returns {Promise} */ - createTransferIn(params: { domain: string, organizationId: string, authCode: string, paymentMethodId: string }): Promise; + createTransferIn(params: { domain: string, organizationId: string, authCode: string, paymentMethodId: string, autoRenewal?: boolean }): Promise; /** * Initiate a domain transfer-in by providing an authorization code, registrant details, and a payment method. Authorizes the payment and returns a `clientSecret`. If 3D Secure is required, use the `clientSecret` on the client to complete the authentication challenge. Once authentication is complete (or if none is needed), call the Update Transfer In endpoint to capture the payment and submit the transfer. * @@ -524,25 +532,27 @@ export class Domains { * @param {string} organizationId - Organization ID that this domain will belong to. * @param {string} authCode - Authorization code for the domain transfer. * @param {string} paymentMethodId - Payment method ID to authorize and capture the transfer. + * @param {boolean} autoRenewal - Whether the domain should renew automatically after transfer. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createTransferIn(domain: string, organizationId: string, authCode: string, paymentMethodId: string): Promise; + createTransferIn(domain: string, organizationId: string, authCode: string, paymentMethodId: string, autoRenewal?: boolean): Promise; createTransferIn( - paramsOrFirst: { domain: string, organizationId: string, authCode: string, paymentMethodId: string } | string, - ...rest: [(string)?, (string)?, (string)?] + paramsOrFirst: { domain: string, organizationId: string, authCode: string, paymentMethodId: string, autoRenewal?: boolean } | string, + ...rest: [(string)?, (string)?, (string)?, (boolean)?] ): Promise { - let params: { domain: string, organizationId: string, authCode: string, paymentMethodId: string }; + let params: { domain: string, organizationId: string, authCode: string, paymentMethodId: string, autoRenewal?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { domain: string, organizationId: string, authCode: string, paymentMethodId: string }; + params = (paramsOrFirst || {}) as { domain: string, organizationId: string, authCode: string, paymentMethodId: string, autoRenewal?: boolean }; } else { params = { domain: paramsOrFirst as string, organizationId: rest[0] as string, authCode: rest[1] as string, - paymentMethodId: rest[2] as string + paymentMethodId: rest[2] as string, + autoRenewal: rest[3] as boolean }; } @@ -550,6 +560,7 @@ export class Domains { const organizationId = params.organizationId; const authCode = params.authCode; const paymentMethodId = params.paymentMethodId; + const autoRenewal = params.autoRenewal; if (typeof domain === 'undefined') { throw new AppwriteException('Missing required parameter: "domain"'); @@ -575,6 +586,9 @@ export class Domains { if (typeof authCode !== 'undefined') { payload['authCode'] = authCode; } + if (typeof autoRenewal !== 'undefined') { + payload['autoRenewal'] = autoRenewal; + } if (typeof paymentMethodId !== 'undefined') { payload['paymentMethodId'] = paymentMethodId; } @@ -826,6 +840,69 @@ export class Domains { ); } + /** + * Enable or disable auto-renewal for a domain. + * + * @param {string} params.domainId - Domain unique ID. + * @param {boolean} params.autoRenewal - Whether the domain should renew automatically. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateAutoRenewal(params: { domainId: string, autoRenewal: boolean }): Promise; + /** + * Enable or disable auto-renewal for a domain. + * + * @param {string} domainId - Domain unique ID. + * @param {boolean} autoRenewal - Whether the domain should renew automatically. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateAutoRenewal(domainId: string, autoRenewal: boolean): Promise; + updateAutoRenewal( + paramsOrFirst: { domainId: string, autoRenewal: boolean } | string, + ...rest: [(boolean)?] + ): Promise { + let params: { domainId: string, autoRenewal: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { domainId: string, autoRenewal: boolean }; + } else { + params = { + domainId: paramsOrFirst as string, + autoRenewal: rest[0] as boolean + }; + } + + const domainId = params.domainId; + const autoRenewal = params.autoRenewal; + + if (typeof domainId === 'undefined') { + throw new AppwriteException('Missing required parameter: "domainId"'); + } + if (typeof autoRenewal === 'undefined') { + throw new AppwriteException('Missing required parameter: "autoRenewal"'); + } + + const apiPath = '/domains/{domainId}/auto-renewal'.replace('{domainId}', domainId); + const payload: Payload = {}; + if (typeof autoRenewal !== 'undefined') { + payload['autoRenewal'] = autoRenewal; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } + /** * Verify which NS records are used and update the domain accordingly. This will check the domain's * nameservers and update the domain's status based on whether the nameservers match the expected From a9cc3e0e5c46c057e148ff37a6afc10a74ec4008 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 26 Mar 2026 05:16:36 +0000 Subject: [PATCH 8/9] chore: update Console SDK to 7.0.0 --- CHANGELOG.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ddc46d3..7204460d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,26 @@ ## 7.0.0 -* Breaking: Updated `$sequence` type from `number` to `string` for rows and documents. -* Updated: Compatibility note now refers to Appwrite server `1.9.x`. -* Updated: README badge shows API version `1.9.0`. -* Updated: Set header `X-Appwrite-Response-Format` to `1.9.0`. +* [BREAKING] Changed `$sequence` type from `number` to `string` for `Row` and `Document` models +* [BREAKING] Renamed `IndexType` enum: split into `DatabasesIndexType` (for Databases) and `TablesDBIndexType` (for TablesDB) +* [BREAKING] `Project.createVariable` now requires `variableId` as a new first parameter +* [BREAKING] Removed `ProviderRepositoryRuntime`, `ProviderRepositoryRuntimeList`, and `DetectionRuntime` models +* [BREAKING] Removed all RC (release candidate) runtime variants from `Runtime`, `Runtimes`, and `BuildRuntime` enums +* Added new `Domains.updateAutoRenewal()` method for enabling/disabling domain auto-renewal +* Added new `Users.updateImpersonator()` method for enabling/disabling user impersonation +* Added impersonation support: `setImpersonateUserId()`, `setImpersonateUserEmail()`, `setImpersonateUserPhone()` on `Client` +* Added `impersonator` and `impersonatorUserId` optional fields to `User` model +* Added `autoRenewal` optional parameter to `Domains.createPurchase()` and `Domains.createTransferIn()` +* Added optional `queries` and `total` parameters to `Project.listVariables()` +* Added `Documentsdb` and `Vectorsdb` values to `DatabaseType` and `BackupServices` enums +* Added new scopes: `Account`, `ProjectRead`, `ProjectWrite`, `PlatformsRead`, `PlatformsWrite`, `ProjectsRead`, `ProjectsWrite`, `KeysRead`, `KeysWrite`, `DevKeysRead`, `DevKeysWrite` +* Added VectorsDB and DocumentsDB usage metrics to `UsagePeriod` model +* Added embeddings metrics (`embeddingsText*`) to `UsagePeriod` model +* Added `realtimeMessages` and `realtimeBandwidth` fields to `Plan` model +* Changed `Project.updateVariable` `key` parameter from required to optional +* Updated `Log` model field descriptions to clarify impersonation behavior +* Updated `X-Appwrite-Response-Format` header to `1.9.0` +* Updated devDependencies: Rollup 2→3, TypeScript 4.7→5.7, and related plugin upgrades ## 6.0.0 From b43518eb2b9c2f409587c07c7374b69b6f28a41f Mon Sep 17 00:00:00 2001 From: root Date: Thu, 26 Mar 2026 05:37:54 +0000 Subject: [PATCH 9/9] chore: update Console SDK to 8.0.0 --- CHANGELOG.md | 2 +- README.md | 2 +- package.json | 2 +- src/client.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7204460d..1262e64c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## 7.0.0 +## 8.0.0 * [BREAKING] Changed `$sequence` type from `number` to `string` for `Row` and `Document` models * [BREAKING] Renamed `IndexType` enum: split into `DatabasesIndexType` (for Databases) and `TablesDBIndexType` (for TablesDB) diff --git a/README.md b/README.md index 7f2e2a90..63ea43a1 100644 --- a/README.md +++ b/README.md @@ -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/package.json b/package.json index 7a3ec73a..3931e1ac 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": "7.0.0", + "version": "8.0.0", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 582c9e1e..1f9d3526 100644 --- a/src/client.ts +++ b/src/client.ts @@ -406,7 +406,7 @@ class Client { 'x-sdk-name': 'Console', 'x-sdk-platform': 'console', 'x-sdk-language': 'web', - 'x-sdk-version': '7.0.0', + 'x-sdk-version': '8.0.0', 'X-Appwrite-Response-Format': '1.9.0', };