Skip to content

Commit cf1efb8

Browse files
feat: introduce 0.15.x support
1 parent 444b71e commit cf1efb8

File tree

148 files changed

+1523
-708
lines changed

Some content is hidden

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

148 files changed

+1523
-708
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.14.0-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-0.15.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.14.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.15.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+
const client = new sdk.Client();
5+
6+
const 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+
const promise = account.createPhoneVerification();
15+
16+
promise.then(function (response) {
17+
console.log(response);
18+
}, function (error) {
19+
console.log(error);
20+
});

docs/examples/account/create-recovery.md

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

33
// Init SDK
4-
let client = new sdk.Client();
4+
const client = new sdk.Client();
55

6-
let account = new sdk.Account(client);
6+
const account = new sdk.Account(client);
77

88
client
99
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
1313

14-
let promise = account.createRecovery('[email protected]', 'https://example.com');
14+
const promise = account.createRecovery('[email protected]', 'https://example.com');
1515

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

docs/examples/account/create-verification.md

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

33
// Init SDK
4-
let client = new sdk.Client();
4+
const client = new sdk.Client();
55

6-
let account = new sdk.Account(client);
6+
const account = new sdk.Account(client);
77

88
client
99
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
1313

14-
let promise = account.createVerification('https://example.com');
14+
const promise = account.createVerification('https://example.com');
1515

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

docs/examples/account/delete-session.md

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

33
// Init SDK
4-
let client = new sdk.Client();
4+
const client = new sdk.Client();
55

6-
let account = new sdk.Account(client);
6+
const account = new sdk.Account(client);
77

88
client
99
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
1313

14-
let promise = account.deleteSession('[SESSION_ID]');
14+
const promise = account.deleteSession('[SESSION_ID]');
1515

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

docs/examples/account/delete-sessions.md

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

33
// Init SDK
4-
let client = new sdk.Client();
4+
const client = new sdk.Client();
55

6-
let account = new sdk.Account(client);
6+
const account = new sdk.Account(client);
77

88
client
99
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
1313

14-
let promise = account.deleteSessions();
14+
const promise = account.deleteSessions();
1515

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

docs/examples/account/get-logs.md

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

33
// Init SDK
4-
let client = new sdk.Client();
4+
const client = new sdk.Client();
55

6-
let account = new sdk.Account(client);
6+
const account = new sdk.Account(client);
77

88
client
99
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
1313

14-
let promise = account.getLogs();
14+
const promise = account.getLogs();
1515

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

docs/examples/account/get-prefs.md

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

33
// Init SDK
4-
let client = new sdk.Client();
4+
const client = new sdk.Client();
55

6-
let account = new sdk.Account(client);
6+
const account = new sdk.Account(client);
77

88
client
99
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
1313

14-
let promise = account.getPrefs();
14+
const promise = account.getPrefs();
1515

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

docs/examples/account/get-session.md

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

33
// Init SDK
4-
let client = new sdk.Client();
4+
const client = new sdk.Client();
55

6-
let account = new sdk.Account(client);
6+
const account = new sdk.Account(client);
77

88
client
99
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
1313

14-
let promise = account.getSession('[SESSION_ID]');
14+
const promise = account.getSession('[SESSION_ID]');
1515

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

docs/examples/account/get-sessions.md

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

33
// Init SDK
4-
let client = new sdk.Client();
4+
const client = new sdk.Client();
55

6-
let account = new sdk.Account(client);
6+
const account = new sdk.Account(client);
77

88
client
99
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
1313

14-
let promise = account.getSessions();
14+
const promise = account.getSessions();
1515

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

docs/examples/account/get.md

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

33
// Init SDK
4-
let client = new sdk.Client();
4+
const client = new sdk.Client();
55

6-
let account = new sdk.Account(client);
6+
const account = new sdk.Account(client);
77

88
client
99
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
1313

14-
let promise = account.get();
14+
const promise = account.get();
1515

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

docs/examples/account/update-email.md

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

33
// Init SDK
4-
let client = new sdk.Client();
4+
const client = new sdk.Client();
55

6-
let account = new sdk.Account(client);
6+
const account = new sdk.Account(client);
77

88
client
99
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
1313

14-
let promise = account.updateEmail('[email protected]', 'password');
14+
const promise = account.updateEmail('[email protected]', 'password');
1515

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

docs/examples/account/update-name.md

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

33
// Init SDK
4-
let client = new sdk.Client();
4+
const client = new sdk.Client();
55

6-
let account = new sdk.Account(client);
6+
const account = new sdk.Account(client);
77

88
client
99
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
1313

14-
let promise = account.updateName('[NAME]');
14+
const promise = account.updateName('[NAME]');
1515

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

docs/examples/account/update-password.md

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

33
// Init SDK
4-
let client = new sdk.Client();
4+
const client = new sdk.Client();
55

6-
let account = new sdk.Account(client);
6+
const account = new sdk.Account(client);
77

88
client
99
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
1313

14-
let promise = account.updatePassword('password');
14+
const promise = account.updatePassword('password');
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+
const client = new sdk.Client();
5+
6+
const 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+
const promise = account.updatePhoneVerification('[USER_ID]', '[SECRET]');
15+
16+
promise.then(function (response) {
17+
console.log(response);
18+
}, function (error) {
19+
console.log(error);
20+
});

docs/examples/database/create-ip-attribute.md renamed to docs/examples/account/update-phone.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
const sdk = require('node-appwrite');
22

33
// Init SDK
4-
let client = new sdk.Client();
4+
const client = new sdk.Client();
55

6-
let database = new sdk.Database(client);
6+
const account = new sdk.Account(client);
77

88
client
99
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
11-
.setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
11+
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
1313

14-
let promise = database.createIpAttribute('[COLLECTION_ID]', '', false);
14+
const promise = account.updatePhone('', 'password');
1515

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

docs/examples/account/update-prefs.md

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

33
// Init SDK
4-
let client = new sdk.Client();
4+
const client = new sdk.Client();
55

6-
let account = new sdk.Account(client);
6+
const account = new sdk.Account(client);
77

88
client
99
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
1313

14-
let promise = account.updatePrefs({});
14+
const promise = account.updatePrefs({});
1515

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

docs/examples/account/update-recovery.md

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

33
// Init SDK
4-
let client = new sdk.Client();
4+
const client = new sdk.Client();
55

6-
let account = new sdk.Account(client);
6+
const account = new sdk.Account(client);
77

88
client
99
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
1313

14-
let promise = account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password');
14+
const promise = account.updateRecovery('[USER_ID]', '[SECRET]', 'password', 'password');
1515

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

docs/examples/account/update-session.md

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

33
// Init SDK
4-
let client = new sdk.Client();
4+
const client = new sdk.Client();
55

6-
let account = new sdk.Account(client);
6+
const account = new sdk.Account(client);
77

88
client
99
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
1111
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1212
;
1313

14-
let promise = account.updateSession('[SESSION_ID]');
14+
const promise = account.updateSession('[SESSION_ID]');
1515

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

0 commit comments

Comments
 (0)