Skip to content

Commit 1b03080

Browse files
Merge pull request appwrite#72 from appwrite/dev
feat: release 1.4.0
2 parents bb6b1e4 + 44063b8 commit 1b03080

File tree

16 files changed

+519
-257
lines changed

16 files changed

+519
-257
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-1.3.0-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.4.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 1.3.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 1.4.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 { 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/appwrite@11.0.0"></script>
36+
<script src="https://cdn.jsdelivr.net/npm/appwrite@12.0.0"></script>
3737
```
3838

3939

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Client, Account } from "appwrite";
2+
3+
const client = new Client();
4+
5+
const account = new Account(client);
6+
7+
client
8+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
12+
const promise = account.deleteIdentity('[IDENTITY_ID]');
13+
14+
promise.then(function (response) {
15+
console.log(response); // Success
16+
}, function (error) {
17+
console.log(error); // Failure
18+
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Client, Account } from "appwrite";
2+
3+
const client = new Client();
4+
5+
const account = new Account(client);
6+
7+
client
8+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
12+
const promise = account.listIdentities();
13+
14+
promise.then(function (response) {
15+
console.log(response); // Success
16+
}, function (error) {
17+
console.log(error); // Failure
18+
});

docs/examples/locale/list-codes.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Client, Locale } from "appwrite";
2+
3+
const client = new Client();
4+
5+
const locale = new Locale(client);
6+
7+
client
8+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
12+
const promise = locale.listCodes();
13+
14+
promise.then(function (response) {
15+
console.log(response); // Success
16+
}, function (error) {
17+
console.log(error); // Failure
18+
});

docs/examples/teams/update-membership-roles.md renamed to docs/examples/teams/update-membership.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ client
99
.setProject('5df5acd0d48c2') // Your project ID
1010
;
1111

12-
const promise = teams.updateMembershipRoles('[TEAM_ID]', '[MEMBERSHIP_ID]', []);
12+
const promise = teams.updateMembership('[TEAM_ID]', '[MEMBERSHIP_ID]', []);
1313

1414
promise.then(function (response) {
1515
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": "11.0.1",
5+
"version": "12.0.0",
66
"license": "BSD-3-Clause",
77
"main": "dist/cjs/sdk.js",
88
"exports": {

src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ class Client {
102102
'x-sdk-name': 'Web',
103103
'x-sdk-platform': 'client',
104104
'x-sdk-language': 'web',
105-
'x-sdk-version': '11.0.0',
106-
'X-Appwrite-Response-Format': '1.0.0',
105+
'x-sdk-version': '12.0.0',
106+
'X-Appwrite-Response-Format': '1.4.0',
107107
};
108108

109109
/**

src/models.ts

Lines changed: 130 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ export namespace Models {
2525
*/
2626
sessions: Session[];
2727
}
28+
/**
29+
* Identities List
30+
*/
31+
export type IdentityList = {
32+
/**
33+
* Total number of identities documents that matched your query.
34+
*/
35+
total: number;
36+
/**
37+
* List of identities.
38+
*/
39+
identities: Identity[];
40+
}
2841
/**
2942
* Logs List
3043
*/
@@ -155,6 +168,19 @@ export namespace Models {
155168
*/
156169
phones: Phone[];
157170
}
171+
/**
172+
* Locale codes list
173+
*/
174+
export type LocaleCodeList = {
175+
/**
176+
* Total number of localeCodes documents that matched your query.
177+
*/
178+
total: number;
179+
/**
180+
* List of localeCodes.
181+
*/
182+
localeCodes: LocaleCode[];
183+
}
158184
/**
159185
* Document
160186
*/
@@ -314,6 +340,10 @@ export namespace Models {
314340
* User status. Pass `true` for enabled and `false` for disabled.
315341
*/
316342
status: boolean;
343+
/**
344+
* Labels for the user.
345+
*/
346+
labels: string[];
317347
/**
318348
* Password update time in ISO 8601 format.
319349
*/
@@ -338,6 +368,10 @@ export namespace Models {
338368
* User preferences as a key-value object
339369
*/
340370
prefs: Preferences;
371+
/**
372+
* Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.
373+
*/
374+
accessedAt: string;
341375
}
342376
/**
343377
* AlgoMD5
@@ -553,6 +587,51 @@ export namespace Models {
553587
*/
554588
current: boolean;
555589
}
590+
/**
591+
* Identity
592+
*/
593+
export type Identity = {
594+
/**
595+
* Identity ID.
596+
*/
597+
$id: string;
598+
/**
599+
* Identity creation date in ISO 8601 format.
600+
*/
601+
$createdAt: string;
602+
/**
603+
* Identity update date in ISO 8601 format.
604+
*/
605+
$updatedAt: string;
606+
/**
607+
* User ID.
608+
*/
609+
userId: string;
610+
/**
611+
* Identity Provider.
612+
*/
613+
provider: string;
614+
/**
615+
* ID of the User in the Identity Provider.
616+
*/
617+
providerUid: string;
618+
/**
619+
* Email of the User in the Identity Provider.
620+
*/
621+
providerEmail: string;
622+
/**
623+
* Identity Provider Access Token.
624+
*/
625+
providerAccessToken: string;
626+
/**
627+
* The date of when the access token expires in ISO 8601 format.
628+
*/
629+
providerAccessTokenExpiry: string;
630+
/**
631+
* Identity Provider Refresh Token.
632+
*/
633+
providerRefreshToken: string;
634+
}
556635
/**
557636
* Token
558637
*/
@@ -620,6 +699,19 @@ export namespace Models {
620699
*/
621700
currency: string;
622701
}
702+
/**
703+
* LocaleCode
704+
*/
705+
export type LocaleCode = {
706+
/**
707+
* Locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
708+
*/
709+
code: string;
710+
/**
711+
* Locale name
712+
*/
713+
name: string;
714+
}
623715
/**
624716
* File
625717
*/
@@ -784,23 +876,39 @@ export namespace Models {
784876
*/
785877
status: string;
786878
/**
787-
* The script status code.
879+
* HTTP request method type.
880+
*/
881+
requestMethod: string;
882+
/**
883+
* HTTP request path and query.
788884
*/
789-
statusCode: number;
885+
requestPath: string;
790886
/**
791-
* The script response output string. Logs the last 4,000 characters of the execution response output.
887+
* HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
792888
*/
793-
response: string;
889+
requestHeaders: Headers[];
794890
/**
795-
* The script stdout output string. Logs the last 4,000 characters of the execution stdout output. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
891+
* HTTP response status code.
796892
*/
797-
stdout: string;
893+
responseStatusCode: number;
798894
/**
799-
* The script stderr output string. Logs the last 4,000 characters of the execution stderr output. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
895+
* HTTP response body. This will return empty unless execution is created as synchronous.
800896
*/
801-
stderr: string;
897+
responseBody: string;
802898
/**
803-
* The script execution duration in seconds.
899+
* HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
900+
*/
901+
responseHeaders: Headers[];
902+
/**
903+
* Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
904+
*/
905+
logs: string;
906+
/**
907+
* Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
908+
*/
909+
errors: string;
910+
/**
911+
* Function execution duration in seconds.
804912
*/
805913
duration: number;
806914
}
@@ -897,4 +1005,17 @@ export namespace Models {
8971005
*/
8981006
countryName: string;
8991007
}
1008+
/**
1009+
* Headers
1010+
*/
1011+
export type Headers = {
1012+
/**
1013+
* Header name.
1014+
*/
1015+
name: string;
1016+
/**
1017+
* Header value.
1018+
*/
1019+
value: string;
1020+
}
9001021
}

0 commit comments

Comments
 (0)