Skip to content

Commit b302d3f

Browse files
feat: support for 0.13.0
1 parent fc3b6be commit b302d3f

34 files changed

+1204
-320
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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-0.12.1-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-0.13.0-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)
88

9-
**This SDK is compatible with Appwrite server version 0.12.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).**
9+
**This SDK is compatible with Appwrite server version 0.13.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).**
1010

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)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const sdk = require('node-appwrite');
2+
3+
// Init SDK
4+
let client = new sdk.Client();
5+
6+
let account = new sdk.Account(client);
7+
8+
client
9+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
10+
.setProject('5df5acd0d48c2') // Your project ID
11+
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
12+
;
13+
14+
let promise = account.updateSession('[SESSION_ID]');
15+
16+
promise.then(function (response) {
17+
console.log(response);
18+
}, function (error) {
19+
console.log(error);
20+
});

docs/examples/functions/create-tag.md renamed to docs/examples/functions/create-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ client
1212
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1313
;
1414

15-
let promise = functions.createTag('[FUNCTION_ID]', '[COMMAND]', fs.createReadStream(__dirname + '/file.png'));
15+
let promise = functions.createDeployment('[FUNCTION_ID]', '[ENTRYPOINT]', fs.createReadStream(__dirname + '/file.png'), false);
1616

1717
promise.then(function (response) {
1818
console.log(response);

docs/examples/functions/delete-tag.md renamed to docs/examples/functions/delete-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ client
1111
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1212
;
1313

14-
let promise = functions.deleteTag('[FUNCTION_ID]', '[TAG_ID]');
14+
let promise = functions.deleteDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]');
1515

1616
promise.then(function (response) {
1717
console.log(response);

docs/examples/functions/update-tag.md renamed to docs/examples/functions/get-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ client
1111
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1212
;
1313

14-
let promise = functions.updateTag('[FUNCTION_ID]', '[TAG]');
14+
let promise = functions.getDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]');
1515

1616
promise.then(function (response) {
1717
console.log(response);

docs/examples/functions/list-tags.md renamed to docs/examples/functions/list-deployments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ client
1111
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1212
;
1313

14-
let promise = functions.listTags('[FUNCTION_ID]');
14+
let promise = functions.listDeployments('[FUNCTION_ID]');
1515

1616
promise.then(function (response) {
1717
console.log(response);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const sdk = require('node-appwrite');
2+
3+
// Init SDK
4+
let client = new sdk.Client();
5+
6+
let functions = new sdk.Functions(client);
7+
8+
client
9+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
10+
.setProject('5df5acd0d48c2') // Your project ID
11+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
12+
;
13+
14+
let promise = functions.retryBuild('[FUNCTION_ID]', '[DEPLOYMENT_ID]', '[BUILD_ID]');
15+
16+
promise.then(function (response) {
17+
console.log(response);
18+
}, function (error) {
19+
console.log(error);
20+
});

docs/examples/functions/get-tag.md renamed to docs/examples/functions/update-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ client
1111
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1212
;
1313

14-
let promise = functions.getTag('[FUNCTION_ID]', '[TAG_ID]');
14+
let promise = functions.updateDeployment('[FUNCTION_ID]', '[DEPLOYMENT_ID]');
1515

1616
promise.then(function (response) {
1717
console.log(response);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const sdk = require('node-appwrite');
2+
3+
// Init SDK
4+
let client = new sdk.Client();
5+
6+
let storage = new sdk.Storage(client);
7+
8+
client
9+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
10+
.setProject('5df5acd0d48c2') // Your project ID
11+
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
12+
;
13+
14+
let promise = storage.createBucket('[BUCKET_ID]', '[NAME]', 'file');
15+
16+
promise.then(function (response) {
17+
console.log(response);
18+
}, function (error) {
19+
console.log(error);
20+
});

docs/examples/storage/create-file.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ client
1212
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
1313
;
1414

15-
let promise = storage.createFile('[FILE_ID]', fs.createReadStream(__dirname + '/file.png'));
15+
let promise = storage.createFile('[BUCKET_ID]', '[FILE_ID]', fs.createReadStream(__dirname + '/file.png'));
1616

1717
promise.then(function (response) {
1818
console.log(response);

0 commit comments

Comments
 (0)