Skip to content

Commit

Permalink
Release candidate 4 for 1.5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Feb 21, 2024
1 parent f68adfb commit dc95079
Show file tree
Hide file tree
Showing 281 changed files with 2,848 additions and 3,654 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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.4.13-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.5.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)
Expand Down
20 changes: 6 additions & 14 deletions docs/examples/account/add-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
const sdk = require('node-appwrite');

// Init SDK
const client = new sdk.Client();

const account = new sdk.Account(client);

client
const client = new sdk.Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setSession('') // The user session to authenticate with
;
.setSession(''); // The user session to authenticate with

const promise = account.addAuthenticator(sdk.AuthenticatorType.Totp);
const account = new sdk.Account(client);

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
const response = await account.addAuthenticator(
sdk.AuthenticatorType.Totp // type
);
18 changes: 4 additions & 14 deletions docs/examples/account/create-anonymous-session.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
const sdk = require('node-appwrite');

// Init SDK
const client = new sdk.Client();

const account = new sdk.Account(client);

client
const client = new sdk.Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
.setProject('5df5acd0d48c2'); // Your project ID

const promise = account.createAnonymousSession();
const account = new sdk.Account(client);

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
const response = await account.createAnonymousSession();
21 changes: 7 additions & 14 deletions docs/examples/account/create-email-password-session.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
const sdk = require('node-appwrite');

// Init SDK
const client = new sdk.Client();

const account = new sdk.Account(client);

client
const client = new sdk.Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
.setProject('5df5acd0d48c2'); // Your project ID

const promise = account.createEmailPasswordSession('email@example.com', 'password');
const account = new sdk.Account(client);

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
const response = await account.createEmailPasswordSession(
'email@example.com', // email
'password' // password
);
22 changes: 8 additions & 14 deletions docs/examples/account/create-email-token.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
const sdk = require('node-appwrite');

// Init SDK
const client = new sdk.Client();

const account = new sdk.Account(client);

client
const client = new sdk.Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
.setProject('5df5acd0d48c2'); // Your project ID

const promise = account.createEmailToken('[USER_ID]', 'email@example.com');
const account = new sdk.Account(client);

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
const response = await account.createEmailToken(
'[USER_ID]', // userId
'email@example.com', // email
false // phrase (optional)
);
18 changes: 4 additions & 14 deletions docs/examples/account/create-j-w-t.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
const sdk = require('node-appwrite');

// Init SDK
const client = new sdk.Client();

const account = new sdk.Account(client);

client
const client = new sdk.Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
.setProject('5df5acd0d48c2'); // Your project ID

const promise = account.createJWT();
const account = new sdk.Account(client);

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
const response = await account.createJWT();
23 changes: 9 additions & 14 deletions docs/examples/account/create-magic-u-r-l-token.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
const sdk = require('node-appwrite');

// Init SDK
const client = new sdk.Client();

const account = new sdk.Account(client);

client
const client = new sdk.Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
.setProject('5df5acd0d48c2'); // Your project ID

const promise = account.createMagicURLToken('[USER_ID]', 'email@example.com');
const account = new sdk.Account(client);

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
const response = await account.createMagicURLToken(
'[USER_ID]', // userId
'email@example.com', // email
'https://example.com', // url (optional)
false // phrase (optional)
);
24 changes: 10 additions & 14 deletions docs/examples/account/create-o-auth2session.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
const sdk = require('node-appwrite');

// Init SDK
const client = new sdk.Client();

const account = new sdk.Account(client);

client
const client = new sdk.Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
.setProject('5df5acd0d48c2'); // Your project ID

const promise = account.createOAuth2Session(sdk.OAuthProvider.Amazon);
const account = new sdk.Account(client);

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
const response = await account.createOAuth2Session(
sdk.OAuthProvider.Amazon, // provider
'https://example.com', // success (optional)
'https://example.com', // failure (optional)
false, // token (optional)
[] // scopes (optional)
);
21 changes: 7 additions & 14 deletions docs/examples/account/create-phone-token.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
const sdk = require('node-appwrite');

// Init SDK
const client = new sdk.Client();

const account = new sdk.Account(client);

client
const client = new sdk.Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
.setProject('5df5acd0d48c2'); // Your project ID

const promise = account.createPhoneToken('[USER_ID]', '+12065550100');
const account = new sdk.Account(client);

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
const response = await account.createPhoneToken(
'[USER_ID]', // userId
'+12065550100' // phone
);
18 changes: 4 additions & 14 deletions docs/examples/account/create-phone-verification.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
const sdk = require('node-appwrite');

// Init SDK
const client = new sdk.Client();

const account = new sdk.Account(client);

client
const client = new sdk.Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setSession('') // The user session to authenticate with
;
.setSession(''); // The user session to authenticate with

const promise = account.createPhoneVerification();
const account = new sdk.Account(client);

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
const response = await account.createPhoneVerification();
21 changes: 7 additions & 14 deletions docs/examples/account/create-recovery.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
const sdk = require('node-appwrite');

// Init SDK
const client = new sdk.Client();

const account = new sdk.Account(client);

client
const client = new sdk.Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setSession('') // The user session to authenticate with
;
.setSession(''); // The user session to authenticate with

const promise = account.createRecovery('email@example.com', 'https://example.com');
const account = new sdk.Account(client);

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
const response = await account.createRecovery(
'email@example.com', // email
'https://example.com' // url
);
21 changes: 7 additions & 14 deletions docs/examples/account/create-session.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
const sdk = require('node-appwrite');

// Init SDK
const client = new sdk.Client();

const account = new sdk.Account(client);

client
const client = new sdk.Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
.setProject('5df5acd0d48c2'); // Your project ID

const promise = account.createSession('[USER_ID]', '[SECRET]');
const account = new sdk.Account(client);

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
const response = await account.createSession(
'[USER_ID]', // userId
'[SECRET]' // secret
);
20 changes: 6 additions & 14 deletions docs/examples/account/create-verification.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
const sdk = require('node-appwrite');

// Init SDK
const client = new sdk.Client();

const account = new sdk.Account(client);

client
const client = new sdk.Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
.setSession('') // The user session to authenticate with
;
.setSession(''); // The user session to authenticate with

const promise = account.createVerification('https://example.com');
const account = new sdk.Account(client);

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
const response = await account.createVerification(
'https://example.com' // url
);
23 changes: 9 additions & 14 deletions docs/examples/account/create.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
const sdk = require('node-appwrite');

// Init SDK
const client = new sdk.Client();

const account = new sdk.Account(client);

client
const client = new sdk.Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
.setProject('5df5acd0d48c2'); // Your project ID

const promise = account.create('[USER_ID]', 'email@example.com', '');
const account = new sdk.Account(client);

promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
const response = await account.create(
'[USER_ID]', // userId
'email@example.com', // email
'', // password
'[NAME]' // name (optional)
);
Loading

0 comments on commit dc95079

Please sign in to comment.