Skip to content

Commit

Permalink
feat: sync with 1.5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
TorstenDittmann committed Jan 18, 2024
1 parent c544752 commit 2368f85
Show file tree
Hide file tree
Showing 15 changed files with 415 additions and 197 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console";
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:

```html
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/[email protected].4"></script>
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/[email protected].5"></script>
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ client
.setProject('5df5acd0d48c2') // Your project ID
;

const promise = account.createMagicURLSession('[USER_ID]', '[email protected]');
const promise = account.createEmailPasswordSession('[email protected]', 'password');

promise.then(function (response) {
console.log(response); // Success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ client
.setProject('5df5acd0d48c2') // Your project ID
;

const promise = account.createEmailSession('[email protected]', 'password');
const promise = account.createMagicURLToken('[USER_ID]', '[email protected]');

promise.then(function (response) {
console.log(response); // Success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ client
.setProject('5df5acd0d48c2') // Your project ID
;

const promise = account.createPhoneSession('[USER_ID]', '+12065550100');
const promise = account.createPhoneToken('[USER_ID]', '+12065550100');

promise.then(function (response) {
console.log(response); // Success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ client
.setProject('5df5acd0d48c2') // Your project ID
;

const promise = account.updatePhoneSession('[USER_ID]', '[SECRET]');
const promise = account.createSession('[USER_ID]', '[SECRET]');

promise.then(function (response) {
console.log(response); // Success
Expand Down
17 changes: 17 additions & 0 deletions docs/examples/account/update-push-target.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Client, Account } from "@appwrite.io/console";

const client = new Client();

const account = new Account(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
;

const promise = account.updatePushTarget('[TARGET_ID]', '[IDENTIFIER]');

promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
2 changes: 1 addition & 1 deletion docs/examples/account/update-recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ client
.setProject('5df5acd0d48c2') // Your project ID
;

const promise = account.updateRecovery('[USER_ID]', '[SECRET]', '', '');
const promise = account.updateRecovery('[USER_ID]', '[SECRET]', '');

promise.then(function (response) {
console.log(response); // Success
Expand Down
18 changes: 18 additions & 0 deletions docs/examples/users/create-session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Client, Users } from "@appwrite.io/console";

const client = new Client();

const users = new Users(client);

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

const promise = users.createSession('[USER_ID]');

promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
18 changes: 18 additions & 0 deletions docs/examples/users/create-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Client, Users } from "@appwrite.io/console";

const client = new Client();

const users = new Users(client);

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

const promise = users.createToken('[USER_ID]');

promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@appwrite.io/console",
"homepage": "https://appwrite.io/support",
"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",
"version": "0.6.0-rc.4",
"version": "0.6.0-rc.5",
"license": "BSD-3-Clause",
"main": "dist/cjs/sdk.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class Client {
'x-sdk-name': 'Console',
'x-sdk-platform': 'console',
'x-sdk-language': 'web',
'x-sdk-version': '0.6.0-rc.4',
'x-sdk-version': '0.6.0-rc.5',
'X-Appwrite-Response-Format': '1.4.0',
};

Expand Down
8 changes: 8 additions & 0 deletions src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,10 @@ export namespace Models {
* Returns true if this the current user session.
*/
factors: number;
/**
* Secret used to authenticate the user. Only included if the request was made with an API key
*/
secret: string;
}
/**
* Identity
Expand Down Expand Up @@ -1490,6 +1494,10 @@ export namespace Models {
* Token expiration date in ISO 8601 format.
*/
expire: string;
/**
* Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.
*/
securityPhrase: string;
}
/**
* JWT
Expand Down
Loading

0 comments on commit 2368f85

Please sign in to comment.