Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Change Log

## 18.2.0

* Added: `Avatars.updatePhoto` and `Avatars.deletePhoto` to upload and remove the current user's profile photo; `updatePhoto` returns the new `Account` model
* Added: `Account` model, the `User` model without `password`, `hash` and `hashOptions`
* Added: `Project.updateOAuth2Webflow`, `OAuthProvider.Webflow`, `ProjectOAuthProviderId.Webflow` and the `OAuth2Webflow` model
* Added: `ProjectKeyScopes.AvatarsWrite` (`avatars.write`)
* Added: optional `total` parameter on `Account.listSessions`, `Console.listOAuth2Providers`, `Console.listOrganizationScopes`, `Console.listProjectScopes`, `Databases.listTransactions`, `DocumentsDB.listTransactions`, `TablesDB.listTransactions`, `VectorsDB.listTransactions`, `Functions.listRuntimes`, `Functions.listSpecifications`, `Locale.listCodes`, `Locale.listContinents`, `Locale.listCountries`, `Locale.listCountriesEU`, `Locale.listCountriesPhones`, `Locale.listCurrencies`, `Locale.listLanguages`, `Notifications.list`, `Sites.listFrameworks`, `Sites.listSpecifications`, `Sites.listTemplates`, `VCS.listNamespaces`, `VCS.listRepositories` and `VCS.listRepositoryBranches`
* Added: optional `current` parameter on `Account.deleteSessions` to choose whether the current session is deleted too
* Added: `channelId` on `Messaging.createPush` and `Messaging.updatePush`
* Added: `UsageEventDimension` values `accept`, `acceptLanguage`, `latitude`, `longitude`, `postalCode`, `protocol`, `queryKeys`, `timeZone` and `weatherCode`, `UsageEventMetric.MessagesFailed`, and `latitude`, `longitude`, `postalCode`, `timeZone` and `weatherCode` on `UsageDataPoint`
* Added: `deno-1.21`, `deno-1.24` and `deno-1.35` are back in the `Runtime` and `BuildRuntime` enums
* Changed: `Push` picks a default client id per user and tab that survives reloads, so tabs no longer take over each other's connection

## 18.1.0

* Breaking: removed `deno-1.21`, `deno-1.24` and `deno-1.35` from `Runtime` and `BuildRuntime` enums
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![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)

**This SDK targets Appwrite server version 2.3.x as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-console/releases) when APIs differ.
**This SDK targets Appwrite server version latest as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-console/releases) when APIs differ.

Appwrite is an open-source backend as a service server that abstracts and simplifies 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 Console 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)

Expand All @@ -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/console@18.1.0"></script>
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@18.2.0"></script>
```

## Getting Started
Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-email-password-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const account = new Account(client);
const result = await account.createEmailPasswordSession({
email: 'email@example.com',
password: 'password',
duration: 60, // optional
});

console.log(result);
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/account/delete-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const client = new Client()

const account = new Account(client);

const result = await account.deleteSessions();
const result = await account.deleteSessions({
current: false, // optional
});

console.log(result);
```
4 changes: 3 additions & 1 deletion docs/examples/account/list-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const client = new Client()

const account = new Account(client);

const result = await account.listSessions();
const result = await account.listSessions({
total: false, // optional
});

console.log(result);
```
13 changes: 13 additions & 0 deletions docs/examples/avatars/delete-photo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
```javascript
import { Client, Avatars } from '@appwrite.io/console';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const avatars = new Avatars(client);

const result = await avatars.deletePhoto();

console.log(result);
```
3 changes: 1 addition & 2 deletions docs/examples/avatars/get-screenshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const avatars = new Avatars(client);
const result = avatars.getScreenshot({
url: 'https://example.com',
headers: {
Authorization: 'Bearer token123',
'X-Custom-Header': 'value',
'Accept-Language': 'en-US,en;q=0.9',
}, // optional
viewportWidth: 1920, // optional
viewportHeight: 1080, // optional
Expand Down
15 changes: 15 additions & 0 deletions docs/examples/avatars/update-photo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Avatars } from '@appwrite.io/console';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const avatars = new Avatars(client);

const result = await avatars.updatePhoto({
file: document.getElementById('uploader').files[0],
});

console.log(result);
```
4 changes: 3 additions & 1 deletion docs/examples/console/list-o-auth-2-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const client = new Client()

const xconsole = new Console(client);

const result = await xconsole.listOAuth2Providers();
const result = await xconsole.listOAuth2Providers({
total: false, // optional
});

console.log(result);
```
4 changes: 3 additions & 1 deletion docs/examples/console/list-organization-scopes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const client = new Client()

const xconsole = new Console(client);

const result = await xconsole.listOrganizationScopes();
const result = await xconsole.listOrganizationScopes({
total: false, // optional
});

console.log(result);
```
4 changes: 3 additions & 1 deletion docs/examples/console/list-project-scopes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const client = new Client()

const xconsole = new Console(client);

const result = await xconsole.listProjectScopes();
const result = await xconsole.listProjectScopes({
total: false, // optional
});

console.log(result);
```
1 change: 1 addition & 0 deletions docs/examples/databases/list-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const databases = new Databases(client);

const result = await databases.listTransactions({
queries: [], // optional
total: false, // optional
});

console.log(result);
Expand Down
1 change: 1 addition & 0 deletions docs/examples/documentsdb/list-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const documentsDB = new DocumentsDB(client);

const result = await documentsDB.listTransactions({
queries: [], // optional
total: false, // optional
});

console.log(result);
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/functions/list-runtimes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const client = new Client()

const functions = new Functions(client);

const result = await functions.listRuntimes();
const result = await functions.listRuntimes({
total: false, // optional
});

console.log(result);
```
1 change: 1 addition & 0 deletions docs/examples/functions/list-specifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const functions = new Functions(client);

const result = await functions.listSpecifications({
type: 'runtimes', // optional
total: false, // optional
});

console.log(result);
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/locale/list-codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const client = new Client()

const locale = new Locale(client);

const result = await locale.listCodes();
const result = await locale.listCodes({
total: false, // optional
});

console.log(result);
```
4 changes: 3 additions & 1 deletion docs/examples/locale/list-continents.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const client = new Client()

const locale = new Locale(client);

const result = await locale.listContinents();
const result = await locale.listContinents({
total: false, // optional
});

console.log(result);
```
4 changes: 3 additions & 1 deletion docs/examples/locale/list-countries-eu.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const client = new Client()

const locale = new Locale(client);

const result = await locale.listCountriesEU();
const result = await locale.listCountriesEU({
total: false, // optional
});

console.log(result);
```
4 changes: 3 additions & 1 deletion docs/examples/locale/list-countries-phones.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const client = new Client()

const locale = new Locale(client);

const result = await locale.listCountriesPhones();
const result = await locale.listCountriesPhones({
total: false, // optional
});

console.log(result);
```
4 changes: 3 additions & 1 deletion docs/examples/locale/list-countries.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const client = new Client()

const locale = new Locale(client);

const result = await locale.listCountries();
const result = await locale.listCountries({
total: false, // optional
});

console.log(result);
```
4 changes: 3 additions & 1 deletion docs/examples/locale/list-currencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const client = new Client()

const locale = new Locale(client);

const result = await locale.listCurrencies();
const result = await locale.listCurrencies({
total: false, // optional
});

console.log(result);
```
4 changes: 3 additions & 1 deletion docs/examples/locale/list-languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const client = new Client()

const locale = new Locale(client);

const result = await locale.listLanguages();
const result = await locale.listLanguages({
total: false, // optional
});

console.log(result);
```
1 change: 1 addition & 0 deletions docs/examples/messaging/create-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const result = await messaging.createPush({
contentAvailable: false, // optional
critical: false, // optional
priority: MessagePriority.Normal, // optional
channelId: '<CHANNEL_ID>', // optional
});

console.log(result);
Expand Down
10 changes: 5 additions & 5 deletions docs/examples/messaging/update-email.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ const messaging = new Messaging(client);

const result = await messaging.updateEmail({
messageId: '<MESSAGE_ID>',
subject: '<SUBJECT>', // optional
content: '<CONTENT>', // optional
topics: [], // optional
users: [], // optional
targets: [], // optional
subject: '<SUBJECT>', // optional
content: '<CONTENT>', // optional
draft: false, // optional
html: false, // optional
cc: [], // optional
bcc: [], // optional
attachments: [], // optional
replyToEmail: 'email@example.com', // optional
replyToName: '<REPLY_TO_NAME>', // optional
draft: false, // optional
html: false, // optional
scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional
attachments: [], // optional
});

console.log(result);
Expand Down
5 changes: 3 additions & 2 deletions docs/examples/messaging/update-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ const messaging = new Messaging(client);

const result = await messaging.updatePush({
messageId: '<MESSAGE_ID>',
title: '<TITLE>', // optional
body: '<BODY>', // optional
topics: [], // optional
users: [], // optional
targets: [], // optional
title: '<TITLE>', // optional
body: '<BODY>', // optional
data: {}, // optional
action: '<ACTION>', // optional
image: '<ID1:ID2>', // optional
Expand All @@ -27,6 +27,7 @@ const result = await messaging.updatePush({
contentAvailable: false, // optional
critical: false, // optional
priority: MessagePriority.Normal, // optional
channelId: '<CHANNEL_ID>', // optional
});

console.log(result);
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/messaging/update-sms.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ const messaging = new Messaging(client);

const result = await messaging.updateSMS({
messageId: '<MESSAGE_ID>',
content: '<CONTENT>', // optional
topics: [], // optional
users: [], // optional
targets: [], // optional
content: '<CONTENT>', // optional
draft: false, // optional
scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional
});
Expand Down
1 change: 1 addition & 0 deletions docs/examples/notifications/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const notifications = new Notifications(client);

const result = await notifications.list({
queries: [], // optional
total: false, // optional
});

console.log(result);
Expand Down
17 changes: 17 additions & 0 deletions docs/examples/project/update-o-auth-2-webflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```javascript
import { Client, Project } from '@appwrite.io/console';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const project = new Project(client);

const result = await project.updateOAuth2Webflow({
clientId: '<CLIENT_ID>', // optional
clientSecret: '<CLIENT_SECRET>', // optional
enabled: false, // optional
});

console.log(result);
```
4 changes: 3 additions & 1 deletion docs/examples/sites/list-frameworks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const client = new Client()

const sites = new Sites(client);

const result = await sites.listFrameworks();
const result = await sites.listFrameworks({
total: false, // optional
});

console.log(result);
```
1 change: 1 addition & 0 deletions docs/examples/sites/list-specifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const sites = new Sites(client);

const result = await sites.listSpecifications({
type: 'runtimes', // optional
total: false, // optional
});

console.log(result);
Expand Down
1 change: 1 addition & 0 deletions docs/examples/sites/list-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const result = await sites.listTemplates({
useCases: [SiteTemplateUseCase.Portfolio], // optional
limit: 1, // optional
offset: 0, // optional
total: false, // optional
});

console.log(result);
Expand Down
1 change: 1 addition & 0 deletions docs/examples/tablesdb/list-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const tablesDB = new TablesDB(client);

const result = await tablesDB.listTransactions({
queries: [], // optional
total: false, // optional
});

console.log(result);
Expand Down
1 change: 1 addition & 0 deletions docs/examples/vcs/list-namespaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const result = await vcs.listNamespaces({
installationId: '<INSTALLATION_ID>',
search: '<SEARCH>', // optional
queries: [], // optional
total: false, // optional
});

console.log(result);
Expand Down
1 change: 1 addition & 0 deletions docs/examples/vcs/list-repositories.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const result = await vcs.listRepositories({
type: VCSDetectionType.Runtime,
search: '<SEARCH>', // optional
queries: [], // optional
total: false, // optional
});

console.log(result);
Expand Down
Loading
Loading