Skip to content

Commit ad40290

Browse files
authored
Merge pull request #117 from appwrite/dev
Dev
2 parents 86111a2 + 0741e6d commit ad40290

21 files changed

+727
-180
lines changed

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## 17.2.0
4+
5+
* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service
6+
* Fix autocompletion not working for `Document` model even when generic is passed
7+
38
## 17.1.0
49

510
* Add `upsertDocument` method
@@ -28,13 +33,13 @@
2833
## 15.0.1
2934

3035
* Remove titles from all function descriptions
31-
* Fix typing for collection "attribute" key
36+
* Fix typing for collection "attribute" key
3237
* Remove unnecessary awaits and asyncs
3338
* Ensure `AppwriteException` response is always string
3439

3540
## 15.0.0
3641

37-
* Fix: pong response & chunked upload
42+
* Fix: pong response & chunked upload
3843

3944
## 14.2.0
4045

@@ -65,4 +70,4 @@
6570
* Rename `templateBranch` to `templateVersion` in `createFunction()`.
6671
* Rename `downloadDeployment()` to `getDeploymentDownload()`
6772

68-
> You can find the new syntax for breaking changes in the [Appwrite API references](https://appwrite.io/docs/references). Select version `1.6.x`.
73+
> You can find the new syntax for breaking changes in the [Appwrite API references](https://appwrite.io/docs/references). Select version `1.6.x`.

docs/examples/databases/create-document.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ const sdk = require('node-appwrite');
22

33
const client = new sdk.Client()
44
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5-
.setSession('') // The user session to authenticate with
6-
.setKey('<YOUR_API_KEY>') // Your secret API key
7-
.setJWT('<YOUR_JWT>'); // Your secret JSON Web Token
5+
.setProject('<YOUR_PROJECT_ID>') // Your project ID
6+
.setSession(''); // The user session to authenticate with
87

98
const databases = new sdk.Databases(client);
109

docs/examples/databases/create-documents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const sdk = require('node-appwrite');
22

33
const client = new sdk.Client()
44
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('<YOUR_PROJECT_ID>') // Your project ID
56
.setKey('<YOUR_API_KEY>'); // Your secret API key
67

78
const databases = new sdk.Databases(client);
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.decrementDocumentAttribute(
11+
'<DATABASE_ID>', // databaseId
12+
'<COLLECTION_ID>', // collectionId
13+
'<DOCUMENT_ID>', // documentId
14+
'', // attribute
15+
null, // value (optional)
16+
null // min (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.incrementDocumentAttribute(
11+
'<DATABASE_ID>', // databaseId
12+
'<COLLECTION_ID>', // collectionId
13+
'<DOCUMENT_ID>', // documentId
14+
'', // attribute
15+
null, // value (optional)
16+
null // max (optional)
17+
);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "node-appwrite",
33
"homepage": "https://appwrite.io/support",
44
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
5-
"version": "17.1.0",
5+
"version": "17.2.0",
66
"license": "BSD-3-Clause",
77
"main": "dist/index.js",
88
"type": "commonjs",

src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class AppwriteException extends Error {
3333
}
3434

3535
function getUserAgent() {
36-
let ua = 'AppwriteNodeJSSDK/17.1.0';
36+
let ua = 'AppwriteNodeJSSDK/17.2.0';
3737

3838
// `process` is a global in Node.js, but not fully available in all runtimes.
3939
const platform: string[] = [];
@@ -82,7 +82,7 @@ class Client {
8282
'x-sdk-name': 'Node.js',
8383
'x-sdk-platform': 'server',
8484
'x-sdk-language': 'nodejs',
85-
'x-sdk-version': '17.1.0',
85+
'x-sdk-version': '17.2.0',
8686
'user-agent' : getUserAgent(),
8787
'X-Appwrite-Response-Format': '1.7.0',
8888
};

0 commit comments

Comments
 (0)