Skip to content

Commit ef0ac25

Browse files
feat: support for 0.14.x
1 parent 49b4af3 commit ef0ac25

File tree

4 files changed

+76
-43
lines changed

4 files changed

+76
-43
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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-0.13.0-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-0.14.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.13.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-web/releases).**
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-web/releases).**
1010

1111
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Web SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1212

@@ -33,7 +33,7 @@ import { Appwrite } 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/appwrite@7.0.0"></script>
36+
<script src="https://cdn.jsdelivr.net/npm/appwrite@8.0.0"></script>
3737
```
3838

3939

docs/examples/account/delete.md renamed to docs/examples/account/update-status.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sdk
55
.setProject('5df5acd0d48c2') // Your project ID
66
;
77

8-
let promise = sdk.account.delete();
8+
let promise = sdk.account.updateStatus();
99

1010
promise.then(function (response) {
1111
console.log(response); // Success

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "appwrite",
33
"homepage": "https://appwrite.io/support",
44
"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",
5-
"version": "7.0.0",
5+
"version": "8.0.0",
66
"license": "BSD-3-Clause",
77
"main": "dist/cjs/sdk.js",
88
"exports": {

src/sdk.ts

Lines changed: 71 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -556,18 +556,22 @@ namespace Models {
556556
* User ID.
557557
*/
558558
userId: string;
559-
/**
560-
* Team ID.
561-
*/
562-
teamId: string;
563559
/**
564560
* User name.
565561
*/
566-
name: string;
562+
userName: string;
567563
/**
568564
* User email address.
569565
*/
570-
email: string;
566+
userEmail: string;
567+
/**
568+
* Team ID.
569+
*/
570+
teamId: string;
571+
/**
572+
* Team name.
573+
*/
574+
teamName: string;
571575
/**
572576
* Date, the user has been invited to join the team in Unix timestamp.
573577
*/
@@ -618,9 +622,9 @@ namespace Models {
618622
*/
619623
statusCode: number;
620624
/**
621-
* The script stdout output string. Logs the last 4,000 characters of the execution stdout output.
625+
* The script response output string. Logs the last 4,000 characters of the execution response output.
622626
*/
623-
stdout: string;
627+
response: string;
624628
/**
625629
* The script stderr output string. Logs the last 4,000 characters of the execution stderr output
626630
*/
@@ -823,7 +827,7 @@ class Appwrite {
823827
locale: '',
824828
};
825829
headers: Headers = {
826-
'x-sdk-version': 'appwrite:web:7.0.0',
830+
'x-sdk-version': 'appwrite:web:8.0.0',
827831
'X-Appwrite-Response-Format': '0.13.0',
828832
};
829833

@@ -1249,28 +1253,6 @@ class Appwrite {
12491253
}, payload);
12501254
},
12511255

1252-
/**
1253-
* Delete Account
1254-
*
1255-
* Delete a currently logged in user account. Behind the scene, the user
1256-
* record is not deleted but permanently blocked from any access. This is done
1257-
* to avoid deleted accounts being overtaken by new users with the same email
1258-
* address. Any user-related resources like documents or storage files should
1259-
* be deleted separately.
1260-
*
1261-
* @throws {AppwriteException}
1262-
* @returns {Promise}
1263-
*/
1264-
delete: async (): Promise<{}> => {
1265-
let path = '/account';
1266-
let payload: Payload = {};
1267-
1268-
const uri = new URL(this.config.endpoint + path);
1269-
return await this.call('delete', uri, {
1270-
'content-type': 'application/json',
1271-
}, payload);
1272-
},
1273-
12741256
/**
12751257
* Update Account Email
12761258
*
@@ -1397,7 +1379,7 @@ class Appwrite {
13971379
*
13981380
* Update currently logged in user password. For validation, user is required
13991381
* to pass in the new password, and the old password. For users created with
1400-
* OAuth and Team Invites, oldPassword is optional.
1382+
* OAuth, Team Invites and Magic URL, oldPassword is optional.
14011383
*
14021384
* @param {string} password
14031385
* @param {string} oldPassword
@@ -1856,6 +1838,9 @@ class Appwrite {
18561838
/**
18571839
* Update Session (Refresh Tokens)
18581840
*
1841+
* Access tokens have limited lifespan and expire to mitigate security risks.
1842+
* If session was created using an OAuth provider, this route can be used to
1843+
* "refresh" the access token.
18591844
*
18601845
* @param {string} sessionId
18611846
* @throws {AppwriteException}
@@ -1901,6 +1886,26 @@ class Appwrite {
19011886
}, payload);
19021887
},
19031888

1889+
/**
1890+
* Update Account Status
1891+
*
1892+
* Block the currently logged in user account. Behind the scene, the user
1893+
* record is not deleted but permanently blocked from any access. To
1894+
* completely delete a user, use the Users API instead.
1895+
*
1896+
* @throws {AppwriteException}
1897+
* @returns {Promise}
1898+
*/
1899+
updateStatus: async <Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>> => {
1900+
let path = '/account/status';
1901+
let payload: Payload = {};
1902+
1903+
const uri = new URL(this.config.endpoint + path);
1904+
return await this.call('patch', uri, {
1905+
'content-type': 'application/json',
1906+
}, payload);
1907+
},
1908+
19041909
/**
19051910
* Create Email Verification
19061911
*
@@ -1988,9 +1993,14 @@ class Appwrite {
19881993
* Get Browser Icon
19891994
*
19901995
* You can use this endpoint to show different browser icons to your users.
1991-
* The code argument receives the browser code as it appears in your user
1992-
* /account/sessions endpoint. Use width, height and quality arguments to
1993-
* change the output settings.
1996+
* The code argument receives the browser code as it appears in your user [GET
1997+
* /account/sessions](/docs/client/account#accountGetSessions) endpoint. Use
1998+
* width, height and quality arguments to change the output settings.
1999+
*
2000+
* When one dimension is specified and the other is 0, the image is scaled
2001+
* with preserved aspect ratio. If both dimensions are 0, the API provides an
2002+
* image at source quality. If dimensions are not specified, the default size
2003+
* of image returned is 100x100px.
19942004
*
19952005
* @param {string} code
19962006
* @param {number} width
@@ -2035,6 +2045,12 @@ class Appwrite {
20352045
* The credit card endpoint will return you the icon of the credit card
20362046
* provider you need. Use width, height and quality arguments to change the
20372047
* output settings.
2048+
*
2049+
* When one dimension is specified and the other is 0, the image is scaled
2050+
* with preserved aspect ratio. If both dimensions are 0, the API provides an
2051+
* image at source quality. If dimensions are not specified, the default size
2052+
* of image returned is 100x100px.
2053+
*
20382054
*
20392055
* @param {string} code
20402056
* @param {number} width
@@ -2112,6 +2128,12 @@ class Appwrite {
21122128
* You can use this endpoint to show different country flags icons to your
21132129
* users. The code argument receives the 2 letter country code. Use width,
21142130
* height and quality arguments to change the output settings.
2131+
*
2132+
* When one dimension is specified and the other is 0, the image is scaled
2133+
* with preserved aspect ratio. If both dimensions are 0, the API provides an
2134+
* image at source quality. If dimensions are not specified, the default size
2135+
* of image returned is 100x100px.
2136+
*
21152137
*
21162138
* @param {string} code
21172139
* @param {number} width
@@ -2157,6 +2179,12 @@ class Appwrite {
21572179
* you want. This endpoint is very useful if you need to crop and display
21582180
* remote images in your app or in case you want to make sure a 3rd party
21592181
* image is properly served using a TLS protocol.
2182+
*
2183+
* When one dimension is specified and the other is 0, the image is scaled
2184+
* with preserved aspect ratio. If both dimensions are 0, the API provides an
2185+
* image at source quality. If dimensions are not specified, the default size
2186+
* of image returned is 400x400px.
2187+
*
21602188
*
21612189
* @param {string} url
21622190
* @param {number} width
@@ -2207,6 +2235,12 @@ class Appwrite {
22072235
* default, a random theme will be selected. The random theme will persist for
22082236
* the user's initials when reloading the same theme will always return for
22092237
* the same initials.
2238+
*
2239+
* When one dimension is specified and the other is 0, the image is scaled
2240+
* with preserved aspect ratio. If both dimensions are 0, the API provides an
2241+
* image at source quality. If dimensions are not specified, the default size
2242+
* of image returned is 100x100px.
2243+
*
22102244
*
22112245
* @param {string} name
22122246
* @param {number} width
@@ -2255,6 +2289,7 @@ class Appwrite {
22552289
*
22562290
* Converts a given plain text to a QR code image. You can use the query
22572291
* parameters to change the size and style of the resulting image.
2292+
*
22582293
*
22592294
* @param {string} text
22602295
* @param {number} size
@@ -2495,9 +2530,7 @@ class Appwrite {
24952530
/**
24962531
* Delete Document
24972532
*
2498-
* Delete a document by its unique ID. This endpoint deletes only the parent
2499-
* documents, its attributes and relations to other documents. Child documents
2500-
* **will not** be deleted.
2533+
* Delete a document by its unique ID.
25012534
*
25022535
* @param {string} collectionId
25032536
* @param {string} documentId

0 commit comments

Comments
 (0)