Skip to content

Commit b19a0bc

Browse files
committed
Release candidate 4 for 1.5.x
1 parent a11f02b commit b19a0bc

File tree

94 files changed

+810
-1132
lines changed

Some content is hidden

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

94 files changed

+810
-1132
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Appwrite Web SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-web.svg?style=flat-square)
4-
![Version](https://img.shields.io/badge/api%20version-1.4.13-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.5.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)
@@ -33,7 +33,7 @@ import { Client, Account } from "appwrite";
3333
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:
3434

3535
```html
36-
<script src="https://cdn.jsdelivr.net/npm/[email protected].3"></script>
36+
<script src="https://cdn.jsdelivr.net/npm/[email protected].4"></script>
3737
```
3838

3939

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
import { Client, AuthenticatorType, Account } from "appwrite";
1+
import { Client, Account, AuthenticatorType } from "appwrite";
22

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

57
const account = new Account(client);
68

7-
client
8-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9-
.setProject('5df5acd0d48c2') // Your project ID
10-
;
11-
12-
const promise = account.addAuthenticator(AuthenticatorType.Totp);
9+
const result = await account.addAuthenticator(
10+
AuthenticatorType.Totp // type
11+
);
1312

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
13+
console.log(response);
Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "appwrite";
22

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

57
const account = new Account(client);
68

7-
client
8-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9-
.setProject('5df5acd0d48c2') // Your project ID
10-
;
11-
12-
const promise = account.createAnonymousSession();
9+
const result = await account.createAnonymousSession();
1310

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
11+
console.log(response);
Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "appwrite";
22

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

57
const account = new Account(client);
68

7-
client
8-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9-
.setProject('5df5acd0d48c2') // Your project ID
10-
;
11-
12-
const promise = account.createEmailPasswordSession('[email protected]', 'password');
9+
const result = await account.createEmailPasswordSession(
10+
'[email protected]', // email
11+
'password' // password
12+
);
1313

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
14+
console.log(response);
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "appwrite";
22

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

57
const account = new Account(client);
68

7-
client
8-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9-
.setProject('5df5acd0d48c2') // Your project ID
10-
;
11-
12-
const promise = account.createEmailToken('[USER_ID]', '[email protected]');
9+
const result = await account.createEmailToken(
10+
'[USER_ID]', // userId
11+
'[email protected]', // email
12+
false // phrase (optional)
13+
);
1314

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
15+
console.log(response);

docs/examples/account/create-j-w-t.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "appwrite";
22

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

57
const account = new Account(client);
68

7-
client
8-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9-
.setProject('5df5acd0d48c2') // Your project ID
10-
;
11-
12-
const promise = account.createJWT();
9+
const result = await account.createJWT();
1310

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
11+
console.log(response);
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "appwrite";
22

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

57
const account = new Account(client);
68

7-
client
8-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9-
.setProject('5df5acd0d48c2') // Your project ID
10-
;
11-
12-
const promise = account.createMagicURLToken('[USER_ID]', '[email protected]');
9+
const result = await account.createMagicURLToken(
10+
'[USER_ID]', // userId
11+
'[email protected]', // email
12+
'https://example.com', // url (optional)
13+
false // phrase (optional)
14+
);
1315

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
16+
console.log(response);
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
import { Client, OAuthProvider, Account } from "appwrite";
1+
import { Client, Account, OAuthProvider } from "appwrite";
22

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

57
const account = new Account(client);
68

7-
client
8-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9-
.setProject('5df5acd0d48c2') // Your project ID
10-
;
11-
12-
// Go to OAuth provider login page
13-
account.createOAuth2Session(OAuthProvider.Amazon);
9+
account.createOAuth2Session(
10+
OAuthProvider.Amazon, // provider
11+
'https://example.com', // success (optional)
12+
'https://example.com', // failure (optional)
13+
false, // token (optional)
14+
[] // scopes (optional)
15+
);
1416

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "appwrite";
22

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

57
const account = new Account(client);
68

7-
client
8-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9-
.setProject('5df5acd0d48c2') // Your project ID
10-
;
11-
12-
const promise = account.createPhoneToken('[USER_ID]', '+12065550100');
9+
const result = await account.createPhoneToken(
10+
'[USER_ID]', // userId
11+
'+12065550100' // phone
12+
);
1313

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
14+
console.log(response);
Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "appwrite";
22

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

57
const account = new Account(client);
68

7-
client
8-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9-
.setProject('5df5acd0d48c2') // Your project ID
10-
;
11-
12-
const promise = account.createPhoneVerification();
9+
const result = await account.createPhoneVerification();
1310

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
11+
console.log(response);
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "appwrite";
22

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

57
const account = new Account(client);
68

7-
client
8-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9-
.setProject('5df5acd0d48c2') // Your project ID
10-
;
11-
12-
const promise = account.createPushTarget('[TARGET_ID]', '[IDENTIFIER]');
9+
const result = await account.createPushTarget(
10+
'[TARGET_ID]', // targetId
11+
'[IDENTIFIER]', // identifier
12+
'[PROVIDER_ID]' // providerId (optional)
13+
);
1314

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
15+
console.log(response);
Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "appwrite";
22

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

57
const account = new Account(client);
68

7-
client
8-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9-
.setProject('5df5acd0d48c2') // Your project ID
10-
;
11-
12-
const promise = account.createRecovery('[email protected]', 'https://example.com');
9+
const result = await account.createRecovery(
10+
'[email protected]', // email
11+
'https://example.com' // url
12+
);
1313

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
14+
console.log(response);
Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "appwrite";
22

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

57
const account = new Account(client);
68

7-
client
8-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9-
.setProject('5df5acd0d48c2') // Your project ID
10-
;
11-
12-
const promise = account.createSession('[USER_ID]', '[SECRET]');
9+
const result = await account.createSession(
10+
'[USER_ID]', // userId
11+
'[SECRET]' // secret
12+
);
1313

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
14+
console.log(response);
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "appwrite";
22

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

57
const account = new Account(client);
68

7-
client
8-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9-
.setProject('5df5acd0d48c2') // Your project ID
10-
;
11-
12-
const promise = account.createVerification('https://example.com');
9+
const result = await account.createVerification(
10+
'https://example.com' // url
11+
);
1312

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
13+
console.log(response);

0 commit comments

Comments
 (0)