Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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: 6 additions & 22 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
# Change Log

## 22.1.0
## 22.1.1

* Fix doc examples with proper formatting
* Add support for the new `Backups` service

## 22.0.0

* Add array-based enum parameters (e.g., `permissions: BrowserPermission[]`).
* Breaking change: `Output` enum has been removed; use `ImageFormat` instead.
* Add `getQueueAudits` support to `Health` service.
* Add longtext/mediumtext/text/varchar attribute and column helpers to `Databases` and `TablesDB` services.

## 21.1.0

* Added ability to create columns and indexes synchronously while creating a table

## 21.0.0

* Rename `VCSDeploymentType` enum to `VCSReferenceType`
* Change `createTemplateDeployment` method signature: replace `version` parameter with `type` (TemplateReferenceType) and `reference` parameters
* Add `getScreenshot` method to `Avatars` service
* Add `Theme`, `Timezone` and `Output` enums
* Removed unused BigNumber import from src/client.ts to clean up dependencies
* Updated documentation examples to include the new encrypt option for text-like attributes (encrypt: false) across multiple examples
* Updated README to specify Appwrite server compatibility with 1.8.x
* Repo cleanup: removed obsolete GitHub workflow and issue template files as part of repository cleanup (non-breaking)
Comment on lines +3 to +8
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check git history for CHANGELOG.md changes
echo "=== Git log for CHANGELOG.md (last 10 commits) ==="
git log --oneline -10 -- CHANGELOG.md
echo ""
echo "=== Diff of previous version of CHANGELOG.md ==="
git show HEAD~1:CHANGELOG.md 2>/dev/null | head -150

Repository: appwrite/sdk-for-node

Length of output: 181


🏁 Script executed:

#!/bin/bash
# First, check the size of CHANGELOG.md
wc -l CHANGELOG.md

echo ""
echo "=== Full CHANGELOG.md content ==="
cat CHANGELOG.md

Repository: appwrite/sdk-for-node

Length of output: 3936


🏁 Script executed:

#!/bin/bash
# Search for Activities service
echo "=== Searching for Activities service ==="
rg "class Activities|service.*Activities" src/ --type ts --type js -i | head -20

echo ""
echo "=== Searching for containsAny/containsAll Query methods ==="
rg "containsAny|containsAll" src/ --type ts --type js | head -20

echo ""
echo "=== Searching for Scopes enum/entries ==="
rg "SchedulesRead|SchedulesWrite|EventsRead" src/ --type ts --type js | head -20

echo ""
echo "=== Searching for encrypt parameter ==="
rg "encrypt.*:.*bool|encrypt.*:.*false" src/ --type ts --type js | head -30

Repository: appwrite/sdk-for-node

Length of output: 7582


🏁 Script executed:

#!/bin/bash
echo "=== Searching for BuildRuntime enum ==="
rg "enum BuildRuntime|class BuildRuntime" src/ --type ts --type js -A 20 | head -50

echo ""
echo "=== Checking Activities service methods ==="
rg "listEvents|getEvent" src/services/activities.ts -A 2 | head -20

Repository: appwrite/sdk-for-node

Length of output: 1848


Add missing 22.1.1 changelog entries for new features.

The 22.1.1 section omits several notable additions shipped in this release:

  • New Activities service with listEvents and getEvent methods
  • New Query methods: containsAny and containsAll
  • New Scopes entries: SchedulesRead, SchedulesWrite, EventsRead
  • New BuildRuntime enum entries
  • New encrypt parameter on text-like column creation methods (createStringColumn, createLongtextColumn, createMediumtextColumn)

The changelog also jumps from 22.1.1 directly to 20.3.0, with entries for 22.1.0, 22.0.0, and 21.x versions missing.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` around lines 3 - 8, The 22.1.1 changelog is missing several
feature entries and intermediate versions; update the 22.1.1 section to list the
new Activities service (methods: listEvents, getEvent), new Query methods
containsAny and containsAll, new Scopes enumerations (SchedulesRead,
SchedulesWrite, EventsRead), added BuildRuntime enum values, and the new encrypt
parameter on text-like column creation methods (createStringColumn,
createLongtextColumn, createMediumtextColumn) and then reorder or insert missing
release headers so changelog no longer jumps from 22.1.1 to 20.3.0 (add entries
for 22.1.0, 22.0.0, and 21.x as appropriate) so the history is complete and each
feature is attributed to the correct release.


## 20.3.0

Expand Down Expand Up @@ -108,4 +92,4 @@
* Rename `templateBranch` to `templateVersion` in `createFunction()`.
* Rename `downloadDeployment()` to `getDeploymentDownload()`

> You can find the new syntax for breaking changes in the [Appwrite API references](https://appwrite.io/docs/references). Select version `1.6.x`.
> You can find the new syntax for breaking changes in the [Appwrite API references](https://appwrite.io/docs/references). Select version `1.6.x`.
2 changes: 1 addition & 1 deletion 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-node/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-node/releases).**

> This is the Node.js SDK for integrating with Appwrite from your Node.js server-side code.
If you're looking to integrate from the browser, you should check [appwrite/sdk-for-web](https://github.com/appwrite/sdk-for-web)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const client = new sdk.Client()
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const health = new sdk.Health(client);
const activities = new sdk.Activities(client);

const result = await health.getQueueThreats({
threshold: null // optional
const result = await activities.getEvent({
eventId: '<EVENT_ID>'
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const client = new sdk.Client()
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const health = new sdk.Health(client);
const activities = new sdk.Activities(client);

const result = await health.getQueueRegionManager({
threshold: null // optional
const result = await activities.listEvents({
queries: '' // optional
});
```
3 changes: 2 additions & 1 deletion docs/examples/databases/create-longtext-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const result = await databases.createLongtextAttribute({
key: '',
required: false,
default: '<DEFAULT>', // optional
array: false // optional
array: false, // optional
encrypt: false // optional
});
```
3 changes: 2 additions & 1 deletion docs/examples/databases/create-mediumtext-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const result = await databases.createMediumtextAttribute({
key: '',
required: false,
default: '<DEFAULT>', // optional
array: false // optional
array: false, // optional
encrypt: false // optional
});
```
3 changes: 2 additions & 1 deletion docs/examples/databases/create-text-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const result = await databases.createTextAttribute({
key: '',
required: false,
default: '<DEFAULT>', // optional
array: false // optional
array: false, // optional
encrypt: false // optional
});
```
3 changes: 2 additions & 1 deletion docs/examples/databases/create-varchar-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const result = await databases.createVarcharAttribute({
size: 1,
required: false,
default: '<DEFAULT>', // optional
array: false // optional
array: false, // optional
encrypt: false // optional
});
```
14 changes: 0 additions & 14 deletions docs/examples/health/get-queue-billing-project-aggregation.md

This file was deleted.

14 changes: 0 additions & 14 deletions docs/examples/health/get-queue-billing-team-aggregation.md

This file was deleted.

14 changes: 0 additions & 14 deletions docs/examples/health/get-queue-priority-builds.md

This file was deleted.

3 changes: 2 additions & 1 deletion docs/examples/tablesdb/create-longtext-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const result = await tablesDB.createLongtextColumn({
key: '',
required: false,
default: '<DEFAULT>', // optional
array: false // optional
array: false, // optional
encrypt: false // optional
});
```
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/create-mediumtext-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const result = await tablesDB.createMediumtextColumn({
key: '',
required: false,
default: '<DEFAULT>', // optional
array: false // optional
array: false, // optional
encrypt: false // optional
});
```
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/create-text-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const result = await tablesDB.createTextColumn({
key: '',
required: false,
default: '<DEFAULT>', // optional
array: false // optional
array: false, // optional
encrypt: false // optional
});
```
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/create-varchar-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const result = await tablesDB.createVarcharColumn({
size: 1,
required: false,
default: '<DEFAULT>', // optional
array: false // optional
array: false, // optional
encrypt: false // optional
});
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "node-appwrite",
"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": "22.1.0",
"version": "22.1.1",
"license": "BSD-3-Clause",
"main": "dist/index.js",
"type": "commonjs",
Expand Down
16 changes: 12 additions & 4 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@ import { fetch, FormData, File } from 'node-fetch-native-with-agent';
import { createAgent } from 'node-fetch-native-with-agent/agent';
import { Models } from './models';
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 @@ -60,7 +68,7 @@ class AppwriteException extends Error {
}

function getUserAgent() {
let ua = 'AppwriteNodeJSSDK/22.1.0';
let ua = 'AppwriteNodeJSSDK/22.1.1';

// `process` is a global in Node.js, but not fully available in all runtimes.
const platform: string[] = [];
Expand Down Expand Up @@ -109,7 +117,7 @@ class Client {
'x-sdk-name': 'Node.js',
'x-sdk-platform': 'server',
'x-sdk-language': 'nodejs',
'x-sdk-version': '22.1.0',
'x-sdk-version': '22.1.1',
'user-agent' : getUserAgent(),
'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
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