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

## 25.1.0

* Added `sizeActual` property to file model for actual stored size after compression
* Added `Deno121`, `Deno124`, and `Deno135` runtime options to `BuildRuntime` and `Runtime` enums
* Updated advisor authentication examples to use API key instead of session
* Updated billing limits properties to be optional in project models

## 25.0.0

* Breaking: Renamed `AuthMethod` enum to `ProjectAuthMethodId`
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/advisor/get-insight.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const sdk = require('node-appwrite');
const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
.setKey('<YOUR_API_KEY>'); // Your secret API key

const advisor = new sdk.Advisor(client);

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/advisor/get-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const sdk = require('node-appwrite');
const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
.setKey('<YOUR_API_KEY>'); // Your secret API key

const advisor = new sdk.Advisor(client);

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/advisor/list-insights.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const sdk = require('node-appwrite');
const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
.setKey('<YOUR_API_KEY>'); // Your secret API key

const advisor = new sdk.Advisor(client);

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/advisor/list-reports.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const sdk = require('node-appwrite');
const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
.setKey('<YOUR_API_KEY>'); // Your secret API key

const advisor = new sdk.Advisor(client);

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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": "25.0.0",
"version": "25.1.0",
"license": "BSD-3-Clause",
"main": "dist/index.js",
"type": "commonjs",
Expand Down
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class AppwriteException extends Error {
}

function getUserAgent() {
let ua = 'AppwriteNodeJSSDK/25.0.0';
let ua = 'AppwriteNodeJSSDK/25.1.0';

// `process` is a global in Node.js, but not fully available in all runtimes.
const platform: string[] = [];
Expand Down Expand Up @@ -128,7 +128,7 @@ class Client {
'x-sdk-name': 'Node.js',
'x-sdk-platform': 'server',
'x-sdk-language': 'nodejs',
'x-sdk-version': '25.0.0',
'x-sdk-version': '25.1.0',
'user-agent' : getUserAgent(),
'X-Appwrite-Response-Format': '1.9.5',
};
Expand Down
3 changes: 3 additions & 0 deletions src/enums/build-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export enum BuildRuntime {
Pythonml311 = 'python-ml-3.11',
Pythonml312 = 'python-ml-3.12',
Pythonml313 = 'python-ml-3.13',
Deno121 = 'deno-1.21',
Deno124 = 'deno-1.24',
Deno135 = 'deno-1.35',
Comment on lines +33 to +35
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Older Deno versions inserted mid-enum

deno-1.21, deno-1.24, and deno-1.35 are added before the already-existing deno-1.40, deno-1.46, and deno-2.0 entries. Were these legacy runtimes newly enabled in the Appwrite 25.0.1 server release, or is this a backfill that was accidentally omitted from earlier SDK versions? Confirming intent helps reviewers of any downstream SDK parity checks.

Deno140 = 'deno-1.40',
Deno146 = 'deno-1.46',
Deno20 = 'deno-2.0',
Expand Down
3 changes: 3 additions & 0 deletions src/enums/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export enum Runtime {
Pythonml311 = 'python-ml-3.11',
Pythonml312 = 'python-ml-3.12',
Pythonml313 = 'python-ml-3.13',
Deno121 = 'deno-1.21',
Deno124 = 'deno-1.24',
Deno135 = 'deno-1.35',
Comment on lines +33 to +35
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Same older Deno versions inserted before newer entries

The Runtime enum mirrors the BuildRuntime change — deno-1.21, deno-1.24, deno-1.35 land before deno-1.40. If this is intentional (server 25.0.1 newly enables these legacy Deno targets), a brief note in the CHANGELOG entry would clarify why older versions are appearing in a minor bump.

Deno140 = 'deno-1.40',
Deno146 = 'deno-1.46',
Deno20 = 'deno-2.0',
Expand Down
22 changes: 13 additions & 9 deletions src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3359,6 +3359,10 @@ export namespace Models {
* File original size in bytes.
*/
sizeOriginal: number;
/**
* File actual stored size in bytes after compression and/or encryption.
*/
sizeActual: number;
/**
* Total number of chunks available
*/
Expand Down Expand Up @@ -4210,7 +4214,7 @@ export namespace Models {
/**
* Billing limits reached
*/
billingLimits: BillingLimits;
billingLimits?: BillingLimits;
/**
* Project blocks information
*/
Expand Down Expand Up @@ -6760,35 +6764,35 @@ export namespace Models {
/**
* Bandwidth limit
*/
bandwidth: number;
bandwidth?: number;
/**
* Storage limit
*/
storage: number;
storage?: number;
/**
* Users limit
*/
users: number;
users?: number;
/**
* Executions limit
*/
executions: number;
executions?: number;
/**
* GBHours limit
*/
GBHours: number;
GBHours?: number;
/**
* Image transformations limit
*/
imageTransformations: number;
imageTransformations?: number;
/**
* Auth phone limit
*/
authPhone: number;
authPhone?: number;
/**
* Budget limit percentage
*/
budgetLimit: number;
budgetLimit?: number;
}

/**
Expand Down
18 changes: 0 additions & 18 deletions test/services/project.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -89,7 +88,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -257,7 +255,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -1431,7 +1428,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -1472,7 +1468,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -1513,7 +1508,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -1554,7 +1548,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -1594,7 +1587,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -1635,7 +1627,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -1676,7 +1667,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -1717,7 +1707,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -1758,7 +1747,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -1799,7 +1787,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -1840,7 +1827,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -1881,7 +1867,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -1942,7 +1927,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -1984,7 +1968,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down Expand Up @@ -2026,7 +2009,6 @@ describe('Project', () => {
'services': [],
'protocols': [],
'region': 'fra',
'billingLimits': {},
'blocks': [],
'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',};
mockedFetch.mockImplementation(() => Response.json(data));
Expand Down
3 changes: 3 additions & 0 deletions test/services/storage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ describe('Storage', () => {
'signature': '5d529fd02b544198ae075bd57c1762bb',
'mimeType': 'image/png',
'sizeOriginal': 17890,
'sizeActual': 12345,
'chunksTotal': 17890,
'chunksUploaded': 17890,
'encryption': true,
Expand Down Expand Up @@ -181,6 +182,7 @@ describe('Storage', () => {
'signature': '5d529fd02b544198ae075bd57c1762bb',
'mimeType': 'image/png',
'sizeOriginal': 17890,
'sizeActual': 12345,
'chunksTotal': 17890,
'chunksUploaded': 17890,
'encryption': true,
Expand Down Expand Up @@ -209,6 +211,7 @@ describe('Storage', () => {
'signature': '5d529fd02b544198ae075bd57c1762bb',
'mimeType': 'image/png',
'sizeOriginal': 17890,
'sizeActual': 12345,
'chunksTotal': 17890,
'chunksUploaded': 17890,
'encryption': true,
Expand Down