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
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
min-release-age=7
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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-1.9.4-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.5-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)
Expand Down 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/console@13.0.0"></script>
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@13.1.0"></script>
```


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

const result = await advisor.deleteReport({
reportId: '<REPORT_ID>'
});

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

const result = await advisor.getInsight({
reportId: '<REPORT_ID>',
insightId: '<INSIGHT_ID>'
});

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

const result = await projects.get({
projectId: '<PROJECT_ID>'
const result = await advisor.getReport({
reportId: '<REPORT_ID>'
});

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

const result = await advisor.listInsights({
reportId: '<REPORT_ID>',
queries: [], // optional
total: false // optional
});

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

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

console.log(result);
```
2 changes: 1 addition & 1 deletion docs/examples/avatars/get-screenshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const result = avatars.getScreenshot({
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional
fullpage: true, // optional
locale: 'en-US', // optional
timezone: Timezone.AmericaNewYork, // optional
timezone: Timezone.AfricaAbidjan, // optional
latitude: 37.7749, // optional
longitude: -122.4194, // optional
accuracy: 100, // optional
Expand Down
16 changes: 16 additions & 0 deletions docs/examples/console/get-email-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Console, ProjectEmailTemplateId, ProjectEmailTemplateLocale } 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 xconsole = new Console(client);

const result = await xconsole.getEmailTemplate({
templateId: ProjectEmailTemplateId.Verification,
locale: ProjectEmailTemplateLocale.Af // optional
});

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

const result = await xconsole.listOrganizationScopes();

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

const result = await presences.delete({
presenceId: '<PRESENCE_ID>'
});

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

const result = await presences.getUsage({
range: UsageRange.24h // optional
});

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

const result = await presences.get({
presenceId: '<PRESENCE_ID>'
});

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

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

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

const result = await presences.updatePresence({
presenceId: '<PRESENCE_ID>',
userId: '<USER_ID>',
status: '<STATUS>', // optional
expiresAt: '2020-10-15T06:38:00.000+00:00', // optional
metadata: {}, // optional
permissions: [Permission.read(Role.any())], // optional
purge: false // optional
});

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

const result = await presences.upsert({
presenceId: '<PRESENCE_ID>',
userId: '<USER_ID>',
status: '<STATUS>',
permissions: [Permission.read(Role.any())], // optional
expiresAt: '2020-10-15T06:38:00.000+00:00', // optional
metadata: {} // optional
});

console.log(result);
```
4 changes: 2 additions & 2 deletions docs/examples/project/create-ephemeral-key.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Project, Scopes } from "@appwrite.io/console";
import { Client, Project, ProjectKeyScopes } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -8,7 +8,7 @@ const client = new Client()
const project = new Project(client);

const result = await project.createEphemeralKey({
scopes: [Scopes.ProjectRead],
scopes: [ProjectKeyScopes.ProjectRead],
duration: 600
});

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/project/create-key.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Project, Scopes } from "@appwrite.io/console";
import { Client, Project, ProjectKeyScopes } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -10,7 +10,7 @@ const project = new Project(client);
const result = await project.createKey({
keyId: '<KEY_ID>',
name: '<NAME>',
scopes: [Scopes.ProjectRead],
scopes: [ProjectKeyScopes.ProjectRead],
expire: '2020-10-15T06:38:00.000+00:00' // optional
});

Expand Down
6 changes: 3 additions & 3 deletions docs/examples/project/get-email-template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Project, EmailTemplateType, EmailTemplateLocale } from "@appwrite.io/console";
import { Client, Project, ProjectEmailTemplateId, ProjectEmailTemplateLocale } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -8,8 +8,8 @@ const client = new Client()
const project = new Project(client);

const result = await project.getEmailTemplate({
templateId: EmailTemplateType.Verification,
locale: EmailTemplateLocale.Af // optional
templateId: ProjectEmailTemplateId.Verification,
locale: ProjectEmailTemplateLocale.Af // optional
});

console.log(result);
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/project/get-o-auth-2-provider.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Project, OAuthProvider } from "@appwrite.io/console";
import { Client, Project, ProjectOAuthProviderId } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -8,7 +8,7 @@ const client = new Client()
const project = new Project(client);

const result = await project.getOAuth2Provider({
providerId: OAuthProvider.Amazon
providerId: ProjectOAuthProviderId.Amazon
});

console.log(result);
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/project/get-policy.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Project, ProjectPolicy } from "@appwrite.io/console";
import { Client, Project, ProjectPolicyId } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -8,7 +8,7 @@ const client = new Client()
const project = new Project(client);

const result = await project.getPolicy({
policyId: ProjectPolicy.PasswordDictionary
policyId: ProjectPolicyId.PasswordDictionary
});

console.log(result);
Expand Down
13 changes: 13 additions & 0 deletions docs/examples/project/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
```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.get();

console.log(result);
```
4 changes: 2 additions & 2 deletions docs/examples/project/update-auth-method.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Project, AuthMethod } from "@appwrite.io/console";
import { Client, Project, ProjectAuthMethodId } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -8,7 +8,7 @@ const client = new Client()
const project = new Project(client);

const result = await project.updateAuthMethod({
methodId: AuthMethod.EmailPassword,
methodId: ProjectAuthMethodId.EmailPassword,
enabled: false
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const client = new Client()

const project = new Project(client);

const result = await project.updateDenyCanonicalEmailPolicy({
const result = await project.updateDenyAliasedEmailPolicy({
enabled: false
});

Expand Down
6 changes: 3 additions & 3 deletions docs/examples/project/update-email-template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Project, EmailTemplateType, EmailTemplateLocale } from "@appwrite.io/console";
import { Client, Project, ProjectEmailTemplateId, ProjectEmailTemplateLocale } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -8,8 +8,8 @@ const client = new Client()
const project = new Project(client);

const result = await project.updateEmailTemplate({
templateId: EmailTemplateType.Verification,
locale: EmailTemplateLocale.Af, // optional
templateId: ProjectEmailTemplateId.Verification,
locale: ProjectEmailTemplateLocale.Af, // optional
subject: '<SUBJECT>', // optional
message: '<MESSAGE>', // optional
senderName: '<SENDER_NAME>', // optional
Expand Down
Loading
Loading