Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
12 changes: 4 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Change Log

## 22.2.0

* Added ttl option to listDocuments for cached responses
* Added getConsolePausing health status endpoint in Health service
* Added Health.getConsolePausing overloads (object and positional)
* Added updateRelationshipAttribute for Databases to manage relationship attributes
* Added console pausing example to health docs
* Made activate optional in createDeployment object parameter
## 23.0.0

* [BREAKING] Changed `$sequence` type from `int` to `string` for rows and documents
* Updated `DatabasesIndexType` usage; bumped API version badge to 1.9.0
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

## 22.1.2

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-1.8.1-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.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 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 SDK is compatible with Appwrite server version 1.9.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
2 changes: 1 addition & 1 deletion docs/examples/databases/create-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const result = await databases.createIndex({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
type: sdk.IndexType.Key,
type: sdk.DatabasesIndexType.Key,
attributes: [],
orders: [sdk.OrderBy.Asc], // optional
lengths: [] // optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/databases/upsert-documents.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
.setKey('<YOUR_API_KEY>'); // Your secret API key
.setSession(''); // The user session to authenticate with

const databases = new sdk.Databases(client);

Expand Down
4 changes: 3 additions & 1 deletion docs/examples/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const result = await functions.create({
providerBranch: '<PROVIDER_BRANCH>', // optional
providerSilentMode: false, // optional
providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional
specification: '' // optional
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 0 // optional
});
```
4 changes: 3 additions & 1 deletion docs/examples/functions/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const result = await functions.update({
providerBranch: '<PROVIDER_BRANCH>', // optional
providerSilentMode: false, // optional
providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional
specification: '' // optional
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 0 // optional
});
```
17 changes: 17 additions & 0 deletions docs/examples/project/create-variable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```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.createVariable({
variableId: '<VARIABLE_ID>',
key: '<KEY>',
value: '<VALUE>',
secret: false // optional
});
```
14 changes: 14 additions & 0 deletions docs/examples/project/delete-variable.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.deleteVariable({
variableId: '<VARIABLE_ID>'
});
```
14 changes: 14 additions & 0 deletions docs/examples/project/get-variable.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.getVariable({
variableId: '<VARIABLE_ID>'
});
```
15 changes: 15 additions & 0 deletions docs/examples/project/list-variables.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.listVariables({
queries: [], // optional
total: false // optional
});
```
17 changes: 17 additions & 0 deletions docs/examples/project/update-variable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```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.updateVariable({
variableId: '<VARIABLE_ID>',
key: '<KEY>', // optional
value: '<VALUE>', // optional
secret: false // optional
});
```
5 changes: 4 additions & 1 deletion docs/examples/sites/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const result = await sites.create({
timeout: 1, // optional
installCommand: '<INSTALL_COMMAND>', // optional
buildCommand: '<BUILD_COMMAND>', // optional
startCommand: '<START_COMMAND>', // optional
outputDirectory: '<OUTPUT_DIRECTORY>', // optional
adapter: sdk.Adapter.Static, // optional
installationId: '<INSTALLATION_ID>', // optional
Expand All @@ -26,6 +27,8 @@ const result = await sites.create({
providerBranch: '<PROVIDER_BRANCH>', // optional
providerSilentMode: false, // optional
providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional
specification: '' // optional
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 0 // optional
});
```
5 changes: 4 additions & 1 deletion docs/examples/sites/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const result = await sites.update({
timeout: 1, // optional
installCommand: '<INSTALL_COMMAND>', // optional
buildCommand: '<BUILD_COMMAND>', // optional
startCommand: '<START_COMMAND>', // optional
outputDirectory: '<OUTPUT_DIRECTORY>', // optional
buildRuntime: sdk.BuildRuntime.Node145, // optional
adapter: sdk.Adapter.Static, // optional
Expand All @@ -26,6 +27,8 @@ const result = await sites.update({
providerBranch: '<PROVIDER_BRANCH>', // optional
providerSilentMode: false, // optional
providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional
specification: '' // optional
buildSpecification: '', // optional
runtimeSpecification: '', // optional
deploymentRetention: 0 // optional
});
```
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/create-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const result = await tablesDB.createIndex({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
type: sdk.IndexType.Key,
type: sdk.TablesDBIndexType.Key,
columns: [],
orders: [sdk.OrderBy.Asc], // optional
lengths: [] // optional
Expand Down
15 changes: 15 additions & 0 deletions docs/examples/users/update-impersonator.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.updateImpersonator({
userId: '<USER_ID>',
impersonator: false
});
```
21 changes: 21 additions & 0 deletions docs/examples/webhooks/create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```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 webhooks = new sdk.Webhooks(client);

const result = await webhooks.create({
webhookId: '<WEBHOOK_ID>',
url: '',
name: '<NAME>',
events: [],
enabled: false, // optional
security: false, // optional
httpUser: '<HTTP_USER>', // optional
httpPass: '<HTTP_PASS>' // optional
});
```
14 changes: 14 additions & 0 deletions docs/examples/webhooks/delete.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 webhooks = new sdk.Webhooks(client);

const result = await webhooks.delete({
webhookId: '<WEBHOOK_ID>'
});
```
14 changes: 14 additions & 0 deletions docs/examples/webhooks/get.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 webhooks = new sdk.Webhooks(client);

const result = await webhooks.get({
webhookId: '<WEBHOOK_ID>'
});
```
15 changes: 15 additions & 0 deletions docs/examples/webhooks/list.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 webhooks = new sdk.Webhooks(client);

const result = await webhooks.list({
queries: [], // optional
total: false // optional
});
```
14 changes: 14 additions & 0 deletions docs/examples/webhooks/update-signature.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 webhooks = new sdk.Webhooks(client);

const result = await webhooks.updateSignature({
webhookId: '<WEBHOOK_ID>'
});
```
21 changes: 21 additions & 0 deletions docs/examples/webhooks/update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```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 webhooks = new sdk.Webhooks(client);

const result = await webhooks.update({
webhookId: '<WEBHOOK_ID>',
name: '<NAME>',
url: '',
events: [],
enabled: false, // optional
security: false, // optional
httpUser: '<HTTP_USER>', // optional
httpPass: '<HTTP_PASS>' // optional
});
```
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"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.3",
"version": "23.0.0",
"license": "BSD-3-Clause",
"main": "dist/index.js",
"type": "commonjs",
"scripts": {
"build": "tsup"
"build": "tsup",
"test": "jest"
},
"exports": {
".": {
Expand Down Expand Up @@ -46,7 +47,8 @@
"tsup": "7.2.0",
"esbuild-plugin-file-path-extensions": "^2.0.0",
"tslib": "2.6.2",
"typescript": "5.4.2"
"typescript": "5.4.2",
"jest": "^29.7.0"
},
"dependencies": {
"json-bigint": "1.0.0",
Expand Down
Loading