Skip to content

Commit 6365d82

Browse files
authored
Merge pull request #135 from appwrite/dev
2 parents 4bede25 + 45362b0 commit 6365d82

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+3483
-977
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,26 @@ on:
55
types: [published]
66
workflow_dispatch:
77

8+
permissions:
9+
id-token: write
10+
contents: read
11+
812
jobs:
913
publish:
1014
runs-on: ubuntu-latest
1115

1216
steps:
1317
- uses: actions/checkout@v4
1418

15-
# Setup Node.js environment
1619
- name: Use Node.js
1720
uses: actions/setup-node@v4
1821
with:
19-
node-version: '20.x'
22+
node-version: '22'
2023
registry-url: 'https://registry.npmjs.org'
2124

22-
# Determine release tag based on the tag name
25+
- name: Update npm to latest version for OIDC support
26+
run: npm install -g npm@latest
27+
2328
- name: Determine release tag
2429
id: release_tag
2530
run: |
@@ -29,14 +34,10 @@ jobs:
2934
echo "tag=latest" >> "$GITHUB_OUTPUT"
3035
fi
3136
32-
# Install dependencies (if any) and build your project (if necessary)
3337
- name: Install dependencies and build
3438
run: |
3539
npm install
3640
npm run build
3741
38-
# Publish to NPM with the appropriate tag
3942
- name: Publish
40-
run: npm publish --tag ${{ steps.release_tag.outputs.tag }}
41-
env:
42-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_NO_ORG }}
43+
run: npm publish --provenance --access public --tag ${{ steps.release_tag.outputs.tag }}

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## 22.0.0
4+
5+
* Add array-based enum parameters (e.g., `permissions: BrowserPermission[]`).
6+
* Breaking change: `Output` enum has been removed; use `ImageFormat` instead.
7+
* Add `getQueueAudits` support to `Health` service.
8+
* Add longtext/mediumtext/text/varchar attribute and column helpers to `Databases` and `TablesDB` services.
9+
310
## 21.1.0
411

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

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2025 Appwrite (https://appwrite.io) and individual contributors.
1+
Copyright (c) 2026 Appwrite (https://appwrite.io) and individual contributors.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Appwrite Node.js SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?style=flat-square)
4-
![Version](https://img.shields.io/badge/api%20version-1.8.0-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.8.1-blue.svg?style=flat-square)
55
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
@@ -11,7 +11,7 @@
1111
> This is the Node.js SDK for integrating with Appwrite from your Node.js server-side code.
1212
If you're looking to integrate from the browser, you should check [appwrite/sdk-for-web](https://github.com/appwrite/sdk-for-web)
1313

14-
Appwrite is an open-source backend as a service server that abstract and simplify 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 Node.js 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)
14+
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 Node.js 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)
1515

1616
![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png)
1717

docs/examples/account/create-jwt.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ const client = new sdk.Client()
77

88
const account = new sdk.Account(client);
99

10-
const result = await account.createJWT();
10+
const result = await account.createJWT({
11+
duration: 0 // optional
12+
});

docs/examples/avatars/get-screenshot.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ const result = await avatars.getScreenshot({
1616
viewportWidth: 1920, // optional
1717
viewportHeight: 1080, // optional
1818
scale: 2, // optional
19-
theme: sdk.Theme.Light, // optional
19+
theme: sdk.Theme.Dark, // optional
2020
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional
2121
fullpage: true, // optional
2222
locale: 'en-US', // optional
23-
timezone: sdk.Timezone.AfricaAbidjan, // optional
23+
timezone: sdk.Timezone.AmericaNewYork, // optional
2424
latitude: 37.7749, // optional
2525
longitude: -122.4194, // optional
2626
accuracy: 100, // optional
2727
touch: true, // optional
28-
permissions: ["geolocation","notifications"], // optional
28+
permissions: [sdk.BrowserPermission.Geolocation, sdk.BrowserPermission.Notifications], // optional
2929
sleep: 3, // optional
3030
width: 800, // optional
3131
height: 600, // optional
3232
quality: 85, // optional
33-
output: sdk.Output.Jpg // optional
33+
output: sdk.ImageFormat.Jpeg // optional
3434
});

docs/examples/databases/create-index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ const result = await databases.createIndex({
1313
key: '',
1414
type: sdk.IndexType.Key,
1515
attributes: [],
16-
orders: [], // optional
16+
orders: [sdk.OrderBy.Asc], // optional
1717
lengths: [] // optional
1818
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const sdk = require('node-appwrite');
2+
3+
const client = new sdk.Client()
4+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('<YOUR_PROJECT_ID>') // Your project ID
6+
.setKey('<YOUR_API_KEY>'); // Your secret API key
7+
8+
const databases = new sdk.Databases(client);
9+
10+
const result = await databases.createLongtextAttribute({
11+
databaseId: '<DATABASE_ID>',
12+
collectionId: '<COLLECTION_ID>',
13+
key: '',
14+
required: false,
15+
default: '<DEFAULT>', // optional
16+
array: false // optional
17+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const sdk = require('node-appwrite');
2+
3+
const client = new sdk.Client()
4+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('<YOUR_PROJECT_ID>') // Your project ID
6+
.setKey('<YOUR_API_KEY>'); // Your secret API key
7+
8+
const databases = new sdk.Databases(client);
9+
10+
const result = await databases.createMediumtextAttribute({
11+
databaseId: '<DATABASE_ID>',
12+
collectionId: '<COLLECTION_ID>',
13+
key: '',
14+
required: false,
15+
default: '<DEFAULT>', // optional
16+
array: false // optional
17+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const sdk = require('node-appwrite');
2+
3+
const client = new sdk.Client()
4+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('<YOUR_PROJECT_ID>') // Your project ID
6+
.setKey('<YOUR_API_KEY>'); // Your secret API key
7+
8+
const databases = new sdk.Databases(client);
9+
10+
const result = await databases.createTextAttribute({
11+
databaseId: '<DATABASE_ID>',
12+
collectionId: '<COLLECTION_ID>',
13+
key: '',
14+
required: false,
15+
default: '<DEFAULT>', // optional
16+
array: false // optional
17+
});

0 commit comments

Comments
 (0)