Skip to content
Closed
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
56 changes: 38 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,54 @@
# Change Log

## 30.0.0-rc.2

* Added: OAuth2 provider `prompt` enums (`OAuth2Auth0Prompt`, `OAuth2GithubPrompt`, and project variants)
* Added: `Topic` and `ResolvedTopic` exports
* Added: `Models.Account` and `Models.OAuth2Webflow` types
* Added: `Webflow` to the `OAuthProvider` and `ProjectOAuthProviderId` enums
* Added: `avatars.updatePhoto()` and `avatars.deletePhoto()` methods
* Added: optional `total` param on locale and list endpoints; `duration` on email-password sessions
* Updated: `chunkedUpload` supports a `text` responseType and falls back without a file
* Updated: several model fields relaxed to optional; `RestorationStatus.options` is now an object

## 30.0.0

* Breaking: `account.listLogs`, `users.listLogs`, `Log` and `LogList` removed
* Breaking: `organization` key methods renamed to `createEphemeralProjectKey`, `getProjectKey`, `listProjectKeys`, `updateProjectKey`, `deleteProjectKey`, and `OrganizationKeyScopes` removed
* Breaking: `organization` key methods renamed to `createEphemeralProjectKey`, `getProjectKey`, `listProjectKeys`, `updateProjectKey`, `deleteProjectKey`
* Breaking: `OrganizationKeyScopes` enum removed
* Breaking: `setDevKey` client method, `DevKey` model and `Project.devKeys` removed
* Breaking: `region`, `reason`, `projectName`, `organizationId`, `organizationName`, `billingPlan` removed from `Block`
* Breaking: `DedicatedDatabaseSpecificationList.pricing` and `DedicatedDatabaseSpecificationPricing` removed; rates now live on each `DedicatedDatabaseSpecification`
* Breaking: `DedicatedDatabaseSpecificationPricing` and `DedicatedDatabaseSpecificationList.pricing` removed; rates live on `DedicatedDatabaseSpecification`
* Breaking: `BillingPlanGroup.Starter` replaced by `Free` and `Start`
* Added: `oauth2.introspect` for RFC 7662 token introspection with an API key, returning the `Oauth2Introspection` model
* Breaking: `resource` on `oauth2` authorize, PAR, device and token methods is now `string[]`
* Breaking: `BackupRestoration.options` is now an object
* Breaking: deprecated positional arguments shift on `teams.createMembership`, `messaging` email/push/SMS and `project.updateOAuth2*`
* Added: `account` passkey methods: `createPasskey`, `updatePasskeyVerification`, `createPasskeyToken`, `updatePasskeyToken`
* Added: `account.listPasskeys`, `getPasskey`, `updatePasskey` and `deletePasskey`
* Added: `users.listPasskeys`, `getPasskey`, `updatePasskey` and `deletePasskey`
* Added: `project.updatePasskeyPolicy` and `passkey` policy and auth method IDs
* Added: `Passkey`, `PasskeyList`, `PasskeyChallenge`, `PolicyPasskey` and `TokenSecret` models
* Added: `fingerprints` on Android platform create and update, and on `PlatformAndroid`
* Added: `waf` service for bypass, challenge, deny, rate limit and redirect rules
* Added: `domains` service for domains, DNS records, email presets, prices and transfers
* Added: `oauth2.introspect` returning the `Oauth2Introspection` model
* Added: `account.createIdTokenSession` and email verification and recovery OTP methods
* Added: `messaging.createAppwriteProvider` and `messaging.updateAppwriteProvider`
* Added: `project.updatePasswordPwnedPolicy` with `PolicyPasswordPwned` model and `User.passwordPwned`
* Added: Kakao and TikTok OAuth2 providers
* Added: `project.updatePasswordPwnedPolicy`, `PolicyPasswordPwned` and `User.passwordPwned`
* Added: Kakao, TikTok and Webflow OAuth2 providers, and `prompt` enums per provider
* Added: native client IDs on the Apple and Google OAuth2 providers
* Added: reply-to on email messages, `qos` and `expiry` on topics
* Added: `avatars.updatePhoto` and `avatars.deletePhoto`
* Added: `membershipId` on `teams.createMembership`
* Added: reply-to on email messages, `channelId` on push, `qos` and `expiry` on topics
* Added: optional `total` on locale and list endpoints, `duration` on email-password sessions
* Added: `Topic`, `ResolvedTopic` and `Models.Account` exports
* Added: `analytics.read`, `analytics.write`, `avatars.write` and `dedicatedDatabases.execute` key scopes
* Added: storage resize fields on `DedicatedDatabase`, `firstAccessedAt` and `mcpAccessedAt` on `Project`
* Added: `ImageGravity.Auto`, `jaspr` framework, and `dart-3.13` and `flutter-3.47` runtimes
* Updated: requests send `X-Appwrite-Response-Format` `2.3.0`
* Added: `project.updatePasswordRotationPolicy` and the `PolicyPasswordRotation` model
* Fixed: response models fill missing fields from spec defaults instead of throwing
* Fixed: object values in multipart requests are sent as JSON
* Updated: `chunkedUpload` supports a `text` response type and works without a file
* Updated: several `Organization`, `UsageBillingPlan` and dedicated database model fields are now optional
* Updated: requests send `X-Appwrite-Response-Format` `2.4.0`

## 29.2.0

* Added: optional `interval` parameter on `functions.create` and `functions.update` to run a function every N minutes
* Added: `interval` on the `Function` model and `functionsIntervalMinimum` on the `BillingPlan` model

## 29.1.0

* Added: optional `state` parameter on `createOAuth2Token`, returned unchanged on the success and failure URLs

## 29.0.0

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Appwrite Node.js SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-2.3.0-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-2.4.0-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![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 targets Appwrite server version 2.3.x as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-node/releases) when APIs differ.
**This SDK targets Appwrite server version 2.4.x as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-node/releases) when APIs differ.

> 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
1 change: 1 addition & 0 deletions docs/examples/account/create-o-auth-2-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ const result = await account.createOAuth2Token({
success: 'https://example.com', // optional
failure: 'https://example.com', // optional
scopes: [], // optional
state: '<STATE>', // optional
});
```
12 changes: 12 additions & 0 deletions docs/examples/account/create-passkey-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```javascript
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

const account = new sdk.Account(client);

const result = await account.createPasskeyToken();
```
15 changes: 15 additions & 0 deletions docs/examples/account/create-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
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

const account = new sdk.Account(client);

const result = await account.createPasskey({
passkeyId: '<PASSKEY_ID>', // optional
name: '<NAME>', // optional
});
```
14 changes: 14 additions & 0 deletions docs/examples/account/delete-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```javascript
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

const account = new sdk.Account(client);

const result = await account.deletePasskey({
passkeyId: '<PASSKEY_ID>',
});
```
14 changes: 14 additions & 0 deletions docs/examples/account/get-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```javascript
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

const account = new sdk.Account(client);

const result = await account.getPasskey({
passkeyId: '<PASSKEY_ID>',
});
```
15 changes: 15 additions & 0 deletions docs/examples/account/list-passkeys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
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

const account = new sdk.Account(client);

const result = await account.listPasskeys({
queries: [], // optional
total: false, // optional
});
```
15 changes: 15 additions & 0 deletions docs/examples/account/update-passkey-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
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

const account = new sdk.Account(client);

const result = await account.updatePasskeyToken({
challengeId: '<CHALLENGE_ID>',
credential: {},
});
```
15 changes: 15 additions & 0 deletions docs/examples/account/update-passkey-verification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
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

const account = new sdk.Account(client);

const result = await account.updatePasskeyVerification({
passkeyId: '<PASSKEY_ID>',
credential: {},
});
```
15 changes: 15 additions & 0 deletions docs/examples/account/update-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
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

const account = new sdk.Account(client);

const result = await account.updatePasskey({
passkeyId: '<PASSKEY_ID>',
name: '<NAME>',
});
```
1 change: 1 addition & 0 deletions docs/examples/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ const result = await functions.create({
buildSpecification: 's-1vcpu-512mb', // optional
runtimeSpecification: 's-1vcpu-512mb', // optional
deploymentRetention: 0, // optional
interval: 0, // optional
});
```
1 change: 1 addition & 0 deletions docs/examples/functions/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ const result = await functions.update({
buildSpecification: 's-1vcpu-512mb', // optional
runtimeSpecification: 's-1vcpu-512mb', // optional
deploymentRetention: 0, // optional
interval: 0, // optional
});
```
2 changes: 1 addition & 1 deletion docs/examples/oauth2/authorize-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const result = await oauth2.authorizePost({
prompt: '<PROMPT>', // optional
maxAge: 0, // optional
authorizationDetails: '<AUTHORIZATION_DETAILS>', // optional
resource: '', // optional
resource: [], // optional
audience: '<AUDIENCE>', // optional
requestUri: '<REQUEST_URI>', // optional
});
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/oauth2/authorize.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const result = await oauth2.authorize({
prompt: '<PROMPT>', // optional
maxAge: 0, // optional
authorizationDetails: '<AUTHORIZATION_DETAILS>', // optional
resource: '', // optional
resource: [], // optional
audience: '<AUDIENCE>', // optional
requestUri: '<REQUEST_URI>', // optional
});
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/oauth2/create-device-authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const result = await oauth2.createDeviceAuthorization({
clientId: '<CLIENT_ID>', // optional
scope: '<SCOPE>', // optional
authorizationDetails: '<AUTHORIZATION_DETAILS>', // optional
resource: '', // optional
resource: [], // optional
audience: '<AUDIENCE>', // optional
});
```
2 changes: 1 addition & 1 deletion docs/examples/oauth2/create-par.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const result = await oauth2.createPAR({
prompt: '<PROMPT>', // optional
maxAge: 0, // optional
authorizationDetails: '<AUTHORIZATION_DETAILS>', // optional
resource: '', // optional
resource: [], // optional
audience: '<AUDIENCE>', // optional
});
```
2 changes: 1 addition & 1 deletion docs/examples/oauth2/create-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const result = await oauth2.createToken({
clientSecret: '<CLIENT_SECRET>', // optional
codeVerifier: '<CODE_VERIFIER>', // optional
redirectUri: 'https://example.com', // optional
resource: '', // optional
resource: [], // optional
audience: '<AUDIENCE>', // optional
});
```
1 change: 1 addition & 0 deletions docs/examples/project/create-android-platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ const result = await project.createAndroidPlatform({
platformId: '<PLATFORM_ID>',
name: '<NAME>',
applicationId: '<APPLICATION_ID>',
fingerprints: [], // optional
});
```
1 change: 1 addition & 0 deletions docs/examples/project/update-android-platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ const result = await project.updateAndroidPlatform({
platformId: '<PLATFORM_ID>',
name: '<NAME>',
applicationId: '<APPLICATION_ID>',
fingerprints: [], // optional
});
```
14 changes: 14 additions & 0 deletions docs/examples/project/update-passkey-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```javascript
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

const project = new sdk.Project(client);

const result = await project.updatePasskeyPolicy({
rpId: '<RP_ID>',
});
```
15 changes: 15 additions & 0 deletions docs/examples/project/update-password-rotation-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

const project = new sdk.Project(client);

const result = await project.updatePasswordRotationPolicy({
enabled: false, // optional
maxAge: 86400, // optional
});
```
1 change: 1 addition & 0 deletions docs/examples/teams/create-membership.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const teams = new sdk.Teams(client);
const result = await teams.createMembership({
teamId: '<TEAM_ID>',
roles: ['editor'],
membershipId: '<MEMBERSHIP_ID>', // optional
email: 'email@example.com', // optional
userId: '<USER_ID>', // optional
phone: '+12065550100', // optional
Expand Down
15 changes: 15 additions & 0 deletions docs/examples/users/delete-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

const users = new sdk.Users(client);

const result = await users.deletePasskey({
userId: '<USER_ID>',
passkeyId: '<PASSKEY_ID>',
});
```
15 changes: 15 additions & 0 deletions docs/examples/users/get-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

const users = new sdk.Users(client);

const result = await users.getPasskey({
userId: '<USER_ID>',
passkeyId: '<PASSKEY_ID>',
});
```
16 changes: 16 additions & 0 deletions docs/examples/users/list-passkeys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

const users = new sdk.Users(client);

const result = await users.listPasskeys({
userId: '<USER_ID>',
queries: [], // optional
total: false, // optional
});
```
16 changes: 16 additions & 0 deletions docs/examples/users/update-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
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
.setKey('<YOUR_API_KEY>'); // Your secret API key

const users = new sdk.Users(client);

const result = await users.updatePasskey({
userId: '<USER_ID>',
passkeyId: '<PASSKEY_ID>',
name: '<NAME>',
});
```
Loading
Loading