Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
# Change Log

## 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`.
## 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)
* [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

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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 <body> tag, but before you use any Appwrite services:

```html
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@7.0.0"></script>
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@8.0.0"></script>
```


Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/create-index.md
Original file line number Diff line number Diff line change
@@ -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://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -11,7 +11,7 @@ const result = await databases.createIndex({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
type: IndexType.Key,
type: DatabasesIndexType.Key,
attributes: [],
orders: [OrderBy.Asc], // optional
lengths: [] // optional
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/domains/create-purchase.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const result = await domains.createPurchase({
paymentMethodId: '<PAYMENT_METHOD_ID>',
addressLine3: '<ADDRESS_LINE3>', // optional
companyName: '<COMPANY_NAME>', // optional
periodYears: 1 // optional
periodYears: 1, // optional
autoRenewal: false // optional
});

console.log(result);
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/domains/create-transfer-in.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const result = await domains.createTransferIn({
domain: '',
organizationId: '<ORGANIZATION_ID>',
authCode: '<AUTH_CODE>',
paymentMethodId: '<PAYMENT_METHOD_ID>'
paymentMethodId: '<PAYMENT_METHOD_ID>',
autoRenewal: false // optional
});

console.log(result);
Expand Down
16 changes: 16 additions & 0 deletions docs/examples/domains/update-auto-renewal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Domains } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const domains = new Domains(client);

const result = await domains.updateAutoRenewal({
domainId: '<DOMAIN_ID>',
autoRenewal: false
});

console.log(result);
```
1 change: 1 addition & 0 deletions docs/examples/project/create-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const client = new Client()
const project = new Project(client);

const result = await project.createVariable({
variableId: '<VARIABLE_ID>',
key: '<KEY>',
value: '<VALUE>',
secret: false // optional
Expand Down
5 changes: 4 additions & 1 deletion docs/examples/project/list-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
```
2 changes: 1 addition & 1 deletion docs/examples/project/update-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const project = new Project(client);

const result = await project.updateVariable({
variableId: '<VARIABLE_ID>',
key: '<KEY>',
key: '<KEY>', // optional
value: '<VALUE>', // optional
secret: false // optional
});
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/tablesdb/create-index.md
Original file line number Diff line number Diff line change
@@ -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://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -11,7 +11,7 @@ const result = await tablesDB.createIndex({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
type: IndexType.Key,
type: TablesDBIndexType.Key,
columns: [],
orders: [OrderBy.Asc], // optional
lengths: [] // optional
Expand Down
16 changes: 16 additions & 0 deletions docs/examples/users/update-impersonator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Users } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const users = new Users(client);

const result = await users.updateImpersonator({
userId: '<USER_ID>',
impersonator: false
});

console.log(result);
```
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
50 changes: 49 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ class Client {
locale: string;
mode: string;
cookie: string;
impersonateuserid: string;
impersonateuseremail: string;
impersonateuserphone: string;
platform: string;
selfSigned: boolean;
session?: string;
Expand All @@ -389,6 +392,9 @@ class Client {
locale: '',
mode: '',
cookie: '',
impersonateuserid: '',
impersonateuseremail: '',
impersonateuserphone: '',
platform: '',
selfSigned: false,
session: undefined,
Expand All @@ -400,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',
};

Expand Down Expand Up @@ -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
*
Expand Down
2 changes: 2 additions & 0 deletions src/enums/appwrite-migration-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export enum AppwriteMigrationResource {
Document = 'document',
Attribute = 'attribute',
Collection = 'collection',
Documentsdb = 'documentsdb',
Vectorsdb = 'vectorsdb',
Bucket = 'bucket',
File = 'file',
Function = 'function',
Expand Down
3 changes: 3 additions & 0 deletions src/enums/backup-services.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export enum BackupServices {
Databases = 'databases',
Tablesdb = 'tablesdb',
Documentsdb = 'documentsdb',
Vectorsdb = 'vectorsdb',
Functions = 'functions',
Storage = 'storage',
}
86 changes: 0 additions & 86 deletions src/enums/build-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
Loading