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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Change Log

## 3.0.0

* Breaking: EmailTemplateType enum values renamed and updated (Magicsession -> MagicSession, Mfachallenge -> MfaChallenge, Sessionalert -> SessionAlert, Otpsession -> OtpSession) and their underlying string values changed accordingly, which may affect existing integrations.
* Breaking: OAuthProvider enum removed GithubImagine and GoogleImagine options, potentially breaking code that referenced those providers.
* New: Channel.upsert() method added to support upserting documents/rows with Channel.
* New: Expanded runtime support with additional runtimes across BuildRuntime, Runtime, and Runtimes enums (Node.js 23-25, PHP 8.4, Ruby 3.4/4.0, Python 3.13/3.14, Deno 2.5/2.6, Bun 1.2/1.3, Go 1.24-1.26, Java 25, Kotlin 2.3, Swift 6.2, etc.).
* Chore: Removed bignumber.js dependency; library now relies on json-bigint and native BigInt handling; ensure compatibility for users that depended on bignumber.js.
* Documentation: Update README to reflect Appwrite server compatibility 1.8.x.
* Maintenance: Changelog updated with 2.3.1 patch: Add missing `queries` parameter to new string type attributes (backward-compatible improvement).

## 2.3.1

* Add missing `queries` parameter to new string type attributes

## 2.3.0

* Add `queries` parameter to `Realtime.subscribe()` and `client.subscribe()` for server-side query filtering
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 latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).**
**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).**

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@2.3.1"></script>
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@3.0.0"></script>
```


Expand Down
20 changes: 20 additions & 0 deletions docs/examples/projects/create-schedule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```javascript
import { Client, Projects, ResourceType } 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 projects = new Projects(client);

const result = await projects.createSchedule({
projectId: '<PROJECT_ID>',
resourceType: ResourceType.Function,
resourceId: '<RESOURCE_ID>',
schedule: '',
active: false, // optional
data: {} // optional
});

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/projects/get-schedule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Projects } 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 projects = new Projects(client);

const result = await projects.getSchedule({
projectId: '<PROJECT_ID>',
scheduleId: '<SCHEDULE_ID>'
});

console.log(result);
```
17 changes: 17 additions & 0 deletions docs/examples/projects/list-schedules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```javascript
import { Client, Projects } 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 projects = new Projects(client);

const result = await projects.listSchedules({
projectId: '<PROJECT_ID>',
queries: [], // optional
total: false // optional
});

console.log(result);
```
5 changes: 2 additions & 3 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": "2.3.1",
"version": "3.0.0",
"license": "BSD-3-Clause",
"main": "dist/cjs/sdk.js",
"exports": {
Expand All @@ -25,8 +25,7 @@
"build:libs": "rollup -c"
},
"dependencies": {
"json-bigint": "1.0.0",
"bignumber.js": "9.0.0"
"json-bigint": "1.0.0"
},
"devDependencies": {
"@rollup/plugin-commonjs": "22.0.0",
Expand Down
4 changes: 4 additions & 0 deletions src/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export class Channel<T> {
return this.resolve("create");
}

upsert(this: Channel<Document | Row>): Channel<Resolved> {
return this.resolve("upsert");
}

update(this: Channel<Actionable>): Channel<Resolved> {
return this.resolve("update");
}
Expand Down
14 changes: 11 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@ import { Models } from './models';
import { Channel, ActionableChannel, ResolvedChannel } from './channel';
import { Query } from './query';
import JSONbigModule from 'json-bigint';
import BigNumber from 'bignumber.js';
const JSONbigParser = JSONbigModule({ storeAsString: false });
const JSONbigSerializer = JSONbigModule({ useNativeBigInt: true });

const MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
const MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);

function isBigNumber(value: any): boolean {
return value !== null
&& typeof value === 'object'
&& value._isBigNumber === true
&& typeof value.isInteger === 'function'
&& typeof value.toFixed === 'function'
&& typeof value.toNumber === 'function';
}

function reviver(_key: string, value: any): any {
if (BigNumber.isBigNumber(value)) {
if (isBigNumber(value)) {
if (value.isInteger()) {
const str = value.toFixed();
const bi = BigInt(str);
Expand Down Expand Up @@ -387,7 +395,7 @@ class Client {
'x-sdk-name': 'Console',
'x-sdk-platform': 'console',
'x-sdk-language': 'web',
'x-sdk-version': '2.3.1',
'x-sdk-version': '3.0.0',
'X-Appwrite-Response-Format': '1.8.0',
};

Expand Down
20 changes: 20 additions & 0 deletions src/enums/build-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,35 @@ export enum BuildRuntime {
Node200 = 'node-20.0',
Node210 = 'node-21.0',
Node22 = 'node-22',
Node23 = 'node-23',
Node24 = 'node-24',
Node25 = 'node-25',
Php80 = 'php-8.0',
Php81 = 'php-8.1',
Php82 = 'php-8.2',
Php83 = 'php-8.3',
Php84 = 'php-8.4',
Ruby30 = 'ruby-3.0',
Ruby31 = 'ruby-3.1',
Ruby32 = 'ruby-3.2',
Ruby33 = 'ruby-3.3',
Ruby34 = 'ruby-3.4',
Ruby40 = 'ruby-4.0',
Python38 = 'python-3.8',
Python39 = 'python-3.9',
Python310 = 'python-3.10',
Python311 = 'python-3.11',
Python312 = 'python-3.12',
Python313 = 'python-3.13',
Python314 = 'python-3.14',
Pythonml311 = 'python-ml-3.11',
Pythonml312 = 'python-ml-3.12',
Pythonml313 = 'python-ml-3.13',
Deno140 = 'deno-1.40',
Deno146 = 'deno-1.46',
Deno20 = 'deno-2.0',
Deno25 = 'deno-2.5',
Deno26 = 'deno-2.6',
Dart215 = 'dart-2.15',
Dart216 = 'dart-2.16',
Dart217 = 'dart-2.17',
Expand All @@ -39,25 +50,34 @@ export enum BuildRuntime {
Dotnet60 = 'dotnet-6.0',
Dotnet70 = 'dotnet-7.0',
Dotnet80 = 'dotnet-8.0',
Dotnet10 = 'dotnet-10',
Java80 = 'java-8.0',
Java110 = 'java-11.0',
Java170 = 'java-17.0',
Java180 = 'java-18.0',
Java210 = 'java-21.0',
Java22 = 'java-22',
Java25 = 'java-25',
Swift55 = 'swift-5.5',
Swift58 = 'swift-5.8',
Swift59 = 'swift-5.9',
Swift510 = 'swift-5.10',
Swift62 = 'swift-6.2',
Kotlin16 = 'kotlin-1.6',
Kotlin18 = 'kotlin-1.8',
Kotlin19 = 'kotlin-1.9',
Kotlin20 = 'kotlin-2.0',
Kotlin23 = 'kotlin-2.3',
Cpp17 = 'cpp-17',
Cpp20 = 'cpp-20',
Bun10 = 'bun-1.0',
Bun11 = 'bun-1.1',
Bun12 = 'bun-1.2',
Bun13 = 'bun-1.3',
Go123 = 'go-1.23',
Go124 = 'go-1.24',
Go125 = 'go-1.25',
Go126 = 'go-1.26',
Static1 = 'static-1',
Flutter324 = 'flutter-3.24',
Flutter327 = 'flutter-3.27',
Expand Down
8 changes: 4 additions & 4 deletions src/enums/email-template-type.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export enum EmailTemplateType {
Verification = 'verification',
Magicsession = 'magicsession',
MagicSession = 'magicSession',
Recovery = 'recovery',
Invitation = 'invitation',
Mfachallenge = 'mfachallenge',
Sessionalert = 'sessionalert',
Otpsession = 'otpsession',
MfaChallenge = 'mfaChallenge',
SessionAlert = 'sessionAlert',
OtpSession = 'otpSession',
}
2 changes: 0 additions & 2 deletions src/enums/o-auth-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,4 @@ export enum OAuthProvider {
Yandex = 'yandex',
Zoho = 'zoho',
Zoom = 'zoom',
GithubImagine = 'githubImagine',
GoogleImagine = 'googleImagine',
}
6 changes: 6 additions & 0 deletions src/enums/resource-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export enum ResourceType {
Function = 'function',
Execution = 'execution',
Message = 'message',
Backup = 'backup',
}
20 changes: 20 additions & 0 deletions src/enums/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,35 @@ export enum Runtime {
Node200 = 'node-20.0',
Node210 = 'node-21.0',
Node22 = 'node-22',
Node23 = 'node-23',
Node24 = 'node-24',
Node25 = 'node-25',
Php80 = 'php-8.0',
Php81 = 'php-8.1',
Php82 = 'php-8.2',
Php83 = 'php-8.3',
Php84 = 'php-8.4',
Ruby30 = 'ruby-3.0',
Ruby31 = 'ruby-3.1',
Ruby32 = 'ruby-3.2',
Ruby33 = 'ruby-3.3',
Ruby34 = 'ruby-3.4',
Ruby40 = 'ruby-4.0',
Python38 = 'python-3.8',
Python39 = 'python-3.9',
Python310 = 'python-3.10',
Python311 = 'python-3.11',
Python312 = 'python-3.12',
Python313 = 'python-3.13',
Python314 = 'python-3.14',
Pythonml311 = 'python-ml-3.11',
Pythonml312 = 'python-ml-3.12',
Pythonml313 = 'python-ml-3.13',
Deno140 = 'deno-1.40',
Deno146 = 'deno-1.46',
Deno20 = 'deno-2.0',
Deno25 = 'deno-2.5',
Deno26 = 'deno-2.6',
Dart215 = 'dart-2.15',
Dart216 = 'dart-2.16',
Dart217 = 'dart-2.17',
Expand All @@ -39,25 +50,34 @@ export enum Runtime {
Dotnet60 = 'dotnet-6.0',
Dotnet70 = 'dotnet-7.0',
Dotnet80 = 'dotnet-8.0',
Dotnet10 = 'dotnet-10',
Java80 = 'java-8.0',
Java110 = 'java-11.0',
Java170 = 'java-17.0',
Java180 = 'java-18.0',
Java210 = 'java-21.0',
Java22 = 'java-22',
Java25 = 'java-25',
Swift55 = 'swift-5.5',
Swift58 = 'swift-5.8',
Swift59 = 'swift-5.9',
Swift510 = 'swift-5.10',
Swift62 = 'swift-6.2',
Kotlin16 = 'kotlin-1.6',
Kotlin18 = 'kotlin-1.8',
Kotlin19 = 'kotlin-1.9',
Kotlin20 = 'kotlin-2.0',
Kotlin23 = 'kotlin-2.3',
Cpp17 = 'cpp-17',
Cpp20 = 'cpp-20',
Bun10 = 'bun-1.0',
Bun11 = 'bun-1.1',
Bun12 = 'bun-1.2',
Bun13 = 'bun-1.3',
Go123 = 'go-1.23',
Go124 = 'go-1.24',
Go125 = 'go-1.25',
Go126 = 'go-1.26',
Static1 = 'static-1',
Flutter324 = 'flutter-3.24',
Flutter327 = 'flutter-3.27',
Expand Down
Loading