@appwrite.io/console 5.0.0 → 7.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +2 -2
- package/dist/cjs/sdk.js +13663 -10879
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +13661 -10880
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +13268 -10484
- package/docs/examples/databases/create-index.md +2 -2
- package/docs/examples/documentsdb/create-collection.md +22 -0
- package/docs/examples/documentsdb/create-document.md +25 -0
- package/docs/examples/documentsdb/create-documents.md +17 -0
- package/docs/examples/documentsdb/create-index.md +21 -0
- package/docs/examples/documentsdb/create-transaction.md +15 -0
- package/docs/examples/documentsdb/create.md +17 -0
- package/docs/examples/documentsdb/decrement-document-attribute.md +21 -0
- package/docs/examples/documentsdb/delete-collection.md +16 -0
- package/docs/examples/documentsdb/delete-document.md +18 -0
- package/docs/examples/documentsdb/delete-documents.md +18 -0
- package/docs/examples/documentsdb/delete-index.md +17 -0
- package/docs/examples/documentsdb/delete-transaction.md +15 -0
- package/docs/examples/documentsdb/delete.md +15 -0
- package/docs/examples/documentsdb/get-collection-usage.md +17 -0
- package/docs/examples/documentsdb/get-collection.md +16 -0
- package/docs/examples/documentsdb/get-document.md +19 -0
- package/docs/examples/documentsdb/get-index.md +17 -0
- package/docs/examples/documentsdb/get-transaction.md +15 -0
- package/docs/examples/documentsdb/get-usage.md +16 -0
- package/docs/examples/documentsdb/get.md +15 -0
- package/docs/examples/documentsdb/increment-document-attribute.md +21 -0
- package/docs/examples/documentsdb/list-collection-logs.md +17 -0
- package/docs/examples/documentsdb/list-collections.md +18 -0
- package/docs/examples/documentsdb/list-document-logs.md +18 -0
- package/docs/examples/documentsdb/list-documents.md +20 -0
- package/docs/examples/documentsdb/list-indexes.md +18 -0
- package/docs/examples/documentsdb/list-transactions.md +15 -0
- package/docs/examples/documentsdb/list-usage.md +15 -0
- package/docs/examples/documentsdb/list.md +17 -0
- package/docs/examples/documentsdb/update-collection.md +20 -0
- package/docs/examples/documentsdb/update-document.md +20 -0
- package/docs/examples/documentsdb/update-documents.md +19 -0
- package/docs/examples/documentsdb/update-transaction.md +17 -0
- package/docs/examples/documentsdb/update.md +17 -0
- package/docs/examples/documentsdb/upsert-document.md +20 -0
- package/docs/examples/documentsdb/upsert-documents.md +18 -0
- package/docs/examples/domains/update-purchase.md +16 -0
- package/docs/examples/domains/update-transfer-in.md +16 -0
- package/docs/examples/tablesdb/create-index.md +2 -2
- package/docs/examples/vectorsdb/create-collection.md +21 -0
- package/docs/examples/vectorsdb/create-document.md +29 -0
- package/docs/examples/vectorsdb/create-documents.md +17 -0
- package/docs/examples/vectorsdb/create-index.md +21 -0
- package/docs/examples/vectorsdb/create-operations.md +26 -0
- package/docs/examples/vectorsdb/create-text-embeddings.md +16 -0
- package/docs/examples/vectorsdb/create-transaction.md +15 -0
- package/docs/examples/vectorsdb/create.md +17 -0
- package/docs/examples/vectorsdb/delete-collection.md +16 -0
- package/docs/examples/vectorsdb/delete-document.md +18 -0
- package/docs/examples/vectorsdb/delete-documents.md +18 -0
- package/docs/examples/vectorsdb/delete-index.md +17 -0
- package/docs/examples/vectorsdb/delete-transaction.md +15 -0
- package/docs/examples/vectorsdb/delete.md +15 -0
- package/docs/examples/vectorsdb/get-collection-usage.md +17 -0
- package/docs/examples/vectorsdb/get-collection.md +16 -0
- package/docs/examples/vectorsdb/get-document.md +19 -0
- package/docs/examples/vectorsdb/get-index.md +17 -0
- package/docs/examples/vectorsdb/get-transaction.md +15 -0
- package/docs/examples/vectorsdb/get-usage.md +16 -0
- package/docs/examples/vectorsdb/get.md +15 -0
- package/docs/examples/vectorsdb/list-collection-logs.md +17 -0
- package/docs/examples/vectorsdb/list-collections.md +18 -0
- package/docs/examples/vectorsdb/list-documents.md +20 -0
- package/docs/examples/vectorsdb/list-indexes.md +18 -0
- package/docs/examples/vectorsdb/list-transactions.md +15 -0
- package/docs/examples/vectorsdb/list-usage.md +15 -0
- package/docs/examples/vectorsdb/list.md +17 -0
- package/docs/examples/vectorsdb/update-collection.md +21 -0
- package/docs/examples/vectorsdb/update-document.md +20 -0
- package/docs/examples/vectorsdb/update-documents.md +19 -0
- package/docs/examples/vectorsdb/update-transaction.md +17 -0
- package/docs/examples/vectorsdb/update.md +17 -0
- package/docs/examples/vectorsdb/upsert-document.md +20 -0
- package/docs/examples/vectorsdb/upsert-documents.md +18 -0
- package/docs/examples/webhooks/create.md +22 -0
- package/docs/examples/webhooks/delete.md +15 -0
- package/docs/examples/webhooks/get.md +15 -0
- package/docs/examples/webhooks/list.md +16 -0
- package/docs/examples/webhooks/update-signature.md +15 -0
- package/docs/examples/webhooks/update.md +22 -0
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/enums/appwrite-migration-resource.ts +2 -0
- package/src/enums/backup-services.ts +3 -0
- package/src/enums/build-runtime.ts +89 -0
- package/src/enums/database-type.ts +2 -0
- package/src/enums/databases-index-type.ts +6 -0
- package/src/enums/documents-db-index-type.ts +6 -0
- package/src/enums/domain-purchase-status.ts +6 -0
- package/src/enums/domain-transfer-status-enum.ts +10 -0
- package/src/enums/model.ts +3 -0
- package/src/enums/runtime.ts +89 -0
- package/src/enums/runtimes.ts +89 -0
- package/src/enums/scopes.ts +2 -0
- package/src/enums/{index-type.ts → tables-db-index-type.ts} +1 -1
- package/src/enums/vectors-db-index-type.ts +8 -0
- package/src/index.ts +11 -4
- package/src/models.ts +519 -19
- package/src/services/databases.ts +10 -10
- package/src/services/documents-db.ts +2608 -0
- package/src/services/domains.ts +30 -30
- package/src/services/projects.ts +0 -473
- package/src/services/tables-db.ts +10 -10
- package/src/services/vectors-db.ts +2406 -0
- package/src/services/webhooks.ts +451 -0
- package/types/enums/appwrite-migration-resource.d.ts +2 -0
- package/types/enums/backup-services.d.ts +3 -0
- package/types/enums/build-runtime.d.ts +90 -1
- package/types/enums/database-type.d.ts +3 -1
- package/types/enums/databases-index-type.d.ts +6 -0
- package/types/enums/documents-db-index-type.d.ts +6 -0
- package/types/enums/domain-purchase-status.d.ts +6 -0
- package/types/enums/domain-transfer-status-enum.d.ts +10 -0
- package/types/enums/model.d.ts +3 -0
- package/types/enums/runtime.d.ts +90 -1
- package/types/enums/runtimes.d.ts +90 -1
- package/types/enums/scopes.d.ts +2 -0
- package/types/enums/{index-type.d.ts → tables-db-index-type.d.ts} +1 -1
- package/types/enums/vectors-db-index-type.d.ts +8 -0
- package/types/index.d.ts +11 -4
- package/types/models.d.ts +509 -19
- package/types/services/databases.d.ts +5 -5
- package/types/services/documents-db.d.ts +977 -0
- package/types/services/domains.d.ts +22 -22
- package/types/services/projects.d.ts +0 -171
- package/types/services/tables-db.d.ts +5 -5
- package/types/services/vectors-db.d.ts +854 -0
- package/types/services/webhooks.d.ts +165 -0
- package/.github/workflows/autoclose.yml +0 -11
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, DocumentsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const documentsDB = new DocumentsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await documentsDB.update({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
name: '<NAME>',
|
|
13
|
+
enabled: false // optional
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
console.log(result);
|
|
17
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, DocumentsDB, Permission, Role } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const documentsDB = new DocumentsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await documentsDB.upsertDocument({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>',
|
|
13
|
+
documentId: '<DOCUMENT_ID>',
|
|
14
|
+
data: {}, // optional
|
|
15
|
+
permissions: [Permission.read(Role.any())], // optional
|
|
16
|
+
transactionId: '<TRANSACTION_ID>' // optional
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
console.log(result);
|
|
20
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, DocumentsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const documentsDB = new DocumentsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await documentsDB.upsertDocuments({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>',
|
|
13
|
+
documents: [],
|
|
14
|
+
transactionId: '<TRANSACTION_ID>' // optional
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
console.log(result);
|
|
18
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, Domains } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const domains = new Domains(client);
|
|
9
|
+
|
|
10
|
+
const result = await domains.updatePurchase({
|
|
11
|
+
domainId: '<DOMAIN_ID>',
|
|
12
|
+
organizationId: '<ORGANIZATION_ID>'
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
console.log(result);
|
|
16
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, Domains } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const domains = new Domains(client);
|
|
9
|
+
|
|
10
|
+
const result = await domains.updateTransferIn({
|
|
11
|
+
domainId: '<DOMAIN_ID>',
|
|
12
|
+
organizationId: '<ORGANIZATION_ID>'
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
console.log(result);
|
|
16
|
+
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
```javascript
|
|
2
|
-
import { Client, TablesDB,
|
|
2
|
+
import { Client, TablesDB, TablesDBIndexType, OrderBy } from "@appwrite.io/console";
|
|
3
3
|
|
|
4
4
|
const client = new Client()
|
|
5
5
|
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
@@ -11,7 +11,7 @@ const result = await tablesDB.createIndex({
|
|
|
11
11
|
databaseId: '<DATABASE_ID>',
|
|
12
12
|
tableId: '<TABLE_ID>',
|
|
13
13
|
key: '',
|
|
14
|
-
type:
|
|
14
|
+
type: TablesDBIndexType.Key,
|
|
15
15
|
columns: [],
|
|
16
16
|
orders: [OrderBy.Asc], // optional
|
|
17
17
|
lengths: [] // optional
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB, Permission, Role } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.createCollection({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>',
|
|
13
|
+
name: '<NAME>',
|
|
14
|
+
dimension: 1,
|
|
15
|
+
permissions: [Permission.read(Role.any())], // optional
|
|
16
|
+
documentSecurity: false, // optional
|
|
17
|
+
enabled: false // optional
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
console.log(result);
|
|
21
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB, Permission, Role } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.createDocument({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>',
|
|
13
|
+
documentId: '<DOCUMENT_ID>',
|
|
14
|
+
data: {
|
|
15
|
+
"embeddings": [
|
|
16
|
+
0.12,
|
|
17
|
+
-0.55,
|
|
18
|
+
0.88,
|
|
19
|
+
1.02
|
|
20
|
+
],
|
|
21
|
+
"metadata": {
|
|
22
|
+
"key": "value"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
permissions: [Permission.read(Role.any())] // optional
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
console.log(result);
|
|
29
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.createDocuments({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>',
|
|
13
|
+
documents: []
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
console.log(result);
|
|
17
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB, VectorsDBIndexType, OrderBy } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.createIndex({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>',
|
|
13
|
+
key: '',
|
|
14
|
+
type: VectorsDBIndexType.HnswEuclidean,
|
|
15
|
+
attributes: [],
|
|
16
|
+
orders: [OrderBy.Asc], // optional
|
|
17
|
+
lengths: [] // optional
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
console.log(result);
|
|
21
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.createOperations({
|
|
11
|
+
transactionId: '<TRANSACTION_ID>',
|
|
12
|
+
operations: [
|
|
13
|
+
{
|
|
14
|
+
"action": "create",
|
|
15
|
+
"databaseId": "<DATABASE_ID>",
|
|
16
|
+
"collectionId": "<COLLECTION_ID>",
|
|
17
|
+
"documentId": "<DOCUMENT_ID>",
|
|
18
|
+
"data": {
|
|
19
|
+
"name": "Walter O'Brien"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
] // optional
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
console.log(result);
|
|
26
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB, Model } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.createTextEmbeddings({
|
|
11
|
+
texts: [],
|
|
12
|
+
model: Model.Embeddinggemma // optional
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
console.log(result);
|
|
16
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.createTransaction({
|
|
11
|
+
ttl: 60 // optional
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
console.log(result);
|
|
15
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.create({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
name: '<NAME>',
|
|
13
|
+
enabled: false // optional
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
console.log(result);
|
|
17
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.deleteCollection({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>'
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
console.log(result);
|
|
16
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.deleteDocument({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>',
|
|
13
|
+
documentId: '<DOCUMENT_ID>',
|
|
14
|
+
transactionId: '<TRANSACTION_ID>' // optional
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
console.log(result);
|
|
18
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.deleteDocuments({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>',
|
|
13
|
+
queries: [], // optional
|
|
14
|
+
transactionId: '<TRANSACTION_ID>' // optional
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
console.log(result);
|
|
18
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.deleteIndex({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>',
|
|
13
|
+
key: ''
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
console.log(result);
|
|
17
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.deleteTransaction({
|
|
11
|
+
transactionId: '<TRANSACTION_ID>'
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
console.log(result);
|
|
15
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.delete({
|
|
11
|
+
databaseId: '<DATABASE_ID>'
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
console.log(result);
|
|
15
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB, UsageRange } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.getCollectionUsage({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>',
|
|
13
|
+
range: UsageRange.TwentyFourHours // optional
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
console.log(result);
|
|
17
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.getCollection({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>'
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
console.log(result);
|
|
16
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.getDocument({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>',
|
|
13
|
+
documentId: '<DOCUMENT_ID>',
|
|
14
|
+
queries: [], // optional
|
|
15
|
+
transactionId: '<TRANSACTION_ID>' // optional
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
console.log(result);
|
|
19
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.getIndex({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>',
|
|
13
|
+
key: ''
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
console.log(result);
|
|
17
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.getTransaction({
|
|
11
|
+
transactionId: '<TRANSACTION_ID>'
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
console.log(result);
|
|
15
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB, UsageRange } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.getUsage({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
range: UsageRange.TwentyFourHours // optional
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
console.log(result);
|
|
16
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.get({
|
|
11
|
+
databaseId: '<DATABASE_ID>'
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
console.log(result);
|
|
15
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.listCollectionLogs({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>',
|
|
13
|
+
queries: [] // optional
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
console.log(result);
|
|
17
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.listCollections({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
queries: [], // optional
|
|
13
|
+
search: '<SEARCH>', // optional
|
|
14
|
+
total: false // optional
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
console.log(result);
|
|
18
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.listDocuments({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>',
|
|
13
|
+
queries: [], // optional
|
|
14
|
+
transactionId: '<TRANSACTION_ID>', // optional
|
|
15
|
+
total: false, // optional
|
|
16
|
+
ttl: 0 // optional
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
console.log(result);
|
|
20
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.listIndexes({
|
|
11
|
+
databaseId: '<DATABASE_ID>',
|
|
12
|
+
collectionId: '<COLLECTION_ID>',
|
|
13
|
+
queries: [], // optional
|
|
14
|
+
total: false // optional
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
console.log(result);
|
|
18
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.listTransactions({
|
|
11
|
+
queries: [] // optional
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
console.log(result);
|
|
15
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB, UsageRange } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.listUsage({
|
|
11
|
+
range: UsageRange.TwentyFourHours // optional
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
console.log(result);
|
|
15
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import { Client, VectorsDB } from "@appwrite.io/console";
|
|
3
|
+
|
|
4
|
+
const client = new Client()
|
|
5
|
+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
|
6
|
+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
7
|
+
|
|
8
|
+
const vectorsDB = new VectorsDB(client);
|
|
9
|
+
|
|
10
|
+
const result = await vectorsDB.list({
|
|
11
|
+
queries: [], // optional
|
|
12
|
+
search: '<SEARCH>', // optional
|
|
13
|
+
total: false // optional
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
console.log(result);
|
|
17
|
+
```
|