Skip to content
Closed
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
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Change Log

## 19.0.0

* Breaking: SDK now targets Appwrite 2.4 (`X-Appwrite-Response-Format: 2.4.0`)
* Breaking: removed `Assistant` service and `_APP_ASSISTANT_ENABLED` from `ConsoleVariables`
* Breaking: positional `Teams.createMembership` takes `membershipId` third, before `email`
* Breaking: `resource` is `string[]` on `OAuth2.authorize`, `authorizePost`, `createDeviceAuthorization`, `createPAR`, `createToken`
* Breaking: `conditions` is `string[]` on every `WAF.create*Rule` and `WAF.update*Rule` method
* Breaking: removed `WafRule` model; `WafRuleList.rules` is a union of the typed rule models
* Breaking: `BackupRestoration.options` is now an `object` instead of a `string`
* Breaking: removed `deno-1.21`, `deno-1.24` and `deno-1.35` from `Runtime` and `BuildRuntime` enums
* Breaking: billing, backup and dedicated database model fields that may be absent are now optional
* Added: `Account` passkey methods: `createPasskey`, `updatePasskeyVerification`, `listPasskeys`, `getPasskey`, `updatePasskey`, `deletePasskey`
* Added: `Account.createPasskeyToken` and `Account.updatePasskeyToken` for passkey sign-in
* Added: `Users.listPasskeys`, `getPasskey`, `updatePasskey` and `deletePasskey`
* Added: `Project.updatePasskeyPolicy`, `ProjectPolicyId.Passkey` and `ProjectAuthMethodId.Passkey`
* Added: `Passkey`, `PasskeyList`, `PasskeyChallenge`, `PolicyPasskey` and `TokenSecret` models
* Added: optional `fingerprints` on `Project.createAndroidPlatform`/`updateAndroidPlatform` and `PlatformAndroid.fingerprints`
* Added: optional `membershipId` on `Teams.createMembership`
* Added: optional `state` on `Account.createOAuth2Session` and `Account.createOAuth2Token`
* Added: `Admin` service with threat methods (`listThreats`, `createThreat`, `getThreat`, `updateThreatStatus`, `deleteThreat`)
* Added: `Admin` cache methods `deletePlatformCache`, `deletePlatformResourceCache`, `deleteProjectCache`, `deleteProjectResourceCache`
* Added: `Threat`, `ThreatList` models and `ThreatStatus`, `ThreatResourceType`, `PlatformResourceType`, `ProjectResourceType` enums
* Added: `Analytics` service with property CRUD, `createEvent` and `listMetrics`
* Added: `Tracking` helper for auto pageviews, outbound links, downloads, scroll depth and engagement
* Added: `AnalyticsProperty`, `AnalyticsPropertyList`, `AnalyticsMetric`, `AnalyticsMetricList` models; `AnalyticsInterval`, `AnalyticsDimension` enums
* Added: `ProjectKeyScopes.AnalyticsRead` and `ProjectKeyScopes.AnalyticsWrite`
* Added: analytics values on `UsageEventMetric`, `UsageGaugeMetric` and `QuerySuggestionResource`
* Added: `ProxyRuleDeploymentResourceType.DedicatedDatabase`
* Added: `avatarsStorageTotal` on `UsageOrganization`
* Added: `Push.onNotificationOpened` and `Push.getInitialNotification` with `PushNotificationOpened` type
* Added: `Project.updatePasswordRotationPolicy` and the `PolicyPasswordRotation` model
* Fixed: response models fill missing fields from spec defaults instead of throwing
* Fixed: `Push` falls back to the signed-in `cookieFallback` session when none is set
* Fixed: `Push` posts one background notification per title, preferring the server-sent title

## 18.3.0

* Added: optional `interval` parameter on `Functions.create`, `Functions.update` and `Projects.createSchedule`
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Appwrite Console SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-console.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-2.3.0-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-2.4.0-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![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 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.
**This SDK targets Appwrite server version 2.4.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.

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

## Getting Started
Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-o-auth-2-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ account.createOAuth2Session({
success: 'https://example.com', // optional
failure: 'https://example.com', // optional
scopes: [], // optional
state: '<STATE>', // optional
});
```
1 change: 1 addition & 0 deletions docs/examples/account/create-o-auth-2-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ account.createOAuth2Token({
success: 'https://example.com', // optional
failure: 'https://example.com', // optional
scopes: [], // optional
state: '<STATE>', // optional
});
```
13 changes: 13 additions & 0 deletions docs/examples/account/create-passkey-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
```javascript
import { Client, Account } 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 account = new Account(client);

const result = await account.createPasskeyToken();

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/account/create-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Account } 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 account = new Account(client);

const result = await account.createPasskey({
passkeyId: '<PASSKEY_ID>', // optional
name: '<NAME>', // optional
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/account/delete-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Account } 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 account = new Account(client);

const result = await account.deletePasskey({
passkeyId: '<PASSKEY_ID>',
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/account/get-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Account } 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 account = new Account(client);

const result = await account.getPasskey({
passkeyId: '<PASSKEY_ID>',
});

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/account/list-passkeys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Account } 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 account = new Account(client);

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

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/account/update-passkey-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Account } 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 account = new Account(client);

const result = await account.updatePasskeyToken({
challengeId: '<CHALLENGE_ID>',
credential: {},
});

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/account/update-passkey-verification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Account } 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 account = new Account(client);

const result = await account.updatePasskeyVerification({
passkeyId: '<PASSKEY_ID>',
credential: {},
});

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/account/update-passkey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Account } 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 account = new Account(client);

const result = await account.updatePasskey({
passkeyId: '<PASSKEY_ID>',
name: '<NAME>',
});

console.log(result);
```
24 changes: 24 additions & 0 deletions docs/examples/admin/create-threat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
```javascript
import {
Client,
Admin,
ThreatResourceType,
ThreatStatus,
} 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 admin = new Admin(client);

const result = await admin.createThreat({
projectId: '<PROJECT_ID>',
resourceType: ThreatResourceType.Projects,
resourceId: '<RESOURCE_ID>',
description: '<DESCRIPTION>', // optional
status: ThreatStatus.Open, // optional
});

console.log(result);
```
13 changes: 13 additions & 0 deletions docs/examples/admin/delete-platform-cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
```javascript
import { Client, Admin } 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 admin = new Admin(client);

const result = await admin.deletePlatformCache();

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/admin/delete-platform-resource-cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Admin, PlatformResourceType } 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 admin = new Admin(client);

const result = await admin.deletePlatformResourceCache({
resourceType: PlatformResourceType.Projects,
resourceId: '<RESOURCE_ID>', // optional
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/admin/delete-project-cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Admin } 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 admin = new Admin(client);

const result = await admin.deleteProjectCache({
projectId: '<PROJECT_ID>',
});

console.log(result);
```
17 changes: 17 additions & 0 deletions docs/examples/admin/delete-project-resource-cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```javascript
import { Client, Admin, ProjectResourceType } 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 admin = new Admin(client);

const result = await admin.deleteProjectResourceCache({
projectId: '<PROJECT_ID>',
resourceType: ProjectResourceType.Users,
resourceId: '<RESOURCE_ID>', // optional
});

console.log(result);
```
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
```javascript
import { Client, Assistant } from '@appwrite.io/console';
import { Client, Admin } 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 assistant = new Assistant(client);
const admin = new Admin(client);

const result = await assistant.chat({
prompt: '<PROMPT>',
const result = await admin.deleteThreat({
threatId: '<THREAT_ID>',
});

console.log(result);
Expand Down
15 changes: 15 additions & 0 deletions docs/examples/admin/get-threat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Admin } 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 admin = new Admin(client);

const result = await admin.getThreat({
threatId: '<THREAT_ID>',
});

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/admin/list-threats.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Admin } 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 admin = new Admin(client);

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

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/admin/update-threat-status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Admin, ThreatStatus } 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 admin = new Admin(client);

const result = await admin.updateThreatStatus({
threatId: '<THREAT_ID>',
status: ThreatStatus.Open,
});

console.log(result);
```
27 changes: 27 additions & 0 deletions docs/examples/analytics/create-event.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
```javascript
import { Client, Analytics } 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 analytics = new Analytics(client);

const result = await analytics.createEvent({
propertyId: '<PROPERTY_ID>',
name: '<NAME>',
url: 'https://example.com',
domain: '<DOMAIN>', // optional
referrer: '<REFERRER>', // optional
screenWidth: null, // optional
sessionHash: '<SESSION_HASH>', // optional
scrollDepth: 0, // optional
engagementTime: 0, // optional
props: [], // optional
userId: '<USER_ID>', // optional
ip: '<IP>', // optional
userAgent: '<USER_AGENT>', // optional
});

console.log(result);
```
Loading
Loading