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
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Change Log

## 12.0.0

* Breaking: Renamed `AuthMethod` enum to `MethodId`
* Breaking: Replaced `Projects.updateAuthStatus` with `Project.updateAuthMethod`
* Breaking: Replaced `Projects.updateOAuth2` with per-provider methods on `Project` service (e.g. `updateOAuth2Google`, `updateOAuth2GitHub`)
* Breaking: Replaced `Projects.updateMockNumbers` with `listMockPhones`, `createMockPhone`, `getMockPhone`, `updateMockPhone`, `deleteMockPhone` on `Project` service
* Breaking: Replaced `Projects.createJWT` with `Project.createEphemeralKey`
* Breaking: Moved `delete` from `Projects` to `Project` service
* Breaking: Renamed `execution.read`/`execution.write` scopes to `executions.read`/`executions.write`
* Breaking: Renamed `domainId` parameter to `invoiceId` in `domains.updatePurchase` and `domains.updateTransferIn`
* Added: `Manager` service with `createBlock`, `deleteBlock`, `listBlocks` methods
* Added: `listEmailTemplates`, `listOAuth2Providers`, `getOAuth2Provider`, `listPolicies`, `getPolicy` methods on `Project` service
* Added: `createPlanEstimation` method on `Organizations` service
* Added: `listOAuth2Providers` and `listProjectScopes` methods on `Console` service
* Added: `fusionauth`, `keycloak`, `kick` to `OAuthProvider` enum
* Added: `MethodId`, `PolicyId` enums
* Added: `mocks.read`, `mocks.write`, `sessions.read` scopes
* Added: `rust-1.83` runtime
* Added: `backup-policy` to `AppwriteMigrationResource` enum
* Added: Plural `ResourceType` values (`projects`, `functions`, `sites`, `databases`, `buckets`, `providers`, `topics`, `subscribers`, `messages`)
* Added: Models for ephemeral keys, mock numbers, email templates, policies, and per-provider OAuth2 settings
* Updated: `X-Appwrite-Response-Format` header to `1.9.3`

## 11.0.0

* Breaking: Moved SMTP, email template, and all policy methods from `Projects` to `Project` service
Expand Down
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.2-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.3-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@11.0.0"></script>
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@12.0.0"></script>
```


Expand Down
13 changes: 13 additions & 0 deletions docs/examples/console/list-o-auth-2-providers.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 console = new Console(client);

const result = await console.listOAuth2Providers();

console.log(result);
```
13 changes: 13 additions & 0 deletions docs/examples/console/list-project-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 console = new Console(client);

const result = await console.listProjectScopes();

console.log(result);
```
2 changes: 1 addition & 1 deletion docs/examples/domains/update-purchase.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const client = new Client()
const domains = new Domains(client);

const result = await domains.updatePurchase({
domainId: '<DOMAIN_ID>',
invoiceId: '<INVOICE_ID>',
organizationId: '<ORGANIZATION_ID>'
});

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/domains/update-transfer-in.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const client = new Client()
const domains = new Domains(client);

const result = await domains.updateTransferIn({
domainId: '<DOMAIN_ID>',
invoiceId: '<INVOICE_ID>',
organizationId: '<ORGANIZATION_ID>'
});

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const result = await functions.create({
logging: false, // optional
entrypoint: '<ENTRYPOINT>', // optional
commands: '<COMMANDS>', // optional
scopes: [Scopes.SessionsWrite], // optional
scopes: [Scopes.ProjectRead], // optional
installationId: '<INSTALLATION_ID>', // optional
providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional
providerBranch: '<PROVIDER_BRANCH>', // optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/functions/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const result = await functions.update({
logging: false, // optional
entrypoint: '<ENTRYPOINT>', // optional
commands: '<COMMANDS>', // optional
scopes: [Scopes.SessionsWrite], // optional
scopes: [Scopes.ProjectRead], // optional
installationId: '<INSTALLATION_ID>', // optional
providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional
providerBranch: '<PROVIDER_BRANCH>', // optional
Expand Down
18 changes: 18 additions & 0 deletions docs/examples/manager/create-block.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```javascript
import { Client, Manager, ResourceType } from "@appwrite.io/console";

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

const manager = new Manager(client);

const result = await manager.createBlock({
projectId: '<PROJECT_ID>',
resourceType: ResourceType.Projects,
resourceId: '<RESOURCE_ID>', // optional
reason: '<REASON>', // optional
expiredAt: '2020-10-15T06:38:00.000+00:00' // optional
});

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/manager/delete-block.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Manager, ResourceType } from "@appwrite.io/console";

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

const manager = new Manager(client);

const result = await manager.deleteBlock({
projectId: '<PROJECT_ID>',
resourceType: ResourceType.Projects,
resourceId: '<RESOURCE_ID>' // optional
});

console.log(result);
```
14 changes: 14 additions & 0 deletions docs/examples/manager/list-blocks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```javascript
import { Client, Manager } from "@appwrite.io/console";

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

const manager = new Manager(client);

const result = await manager.listBlocks({
projectId: '<PROJECT_ID>'
});

console.log(result);
```
17 changes: 17 additions & 0 deletions docs/examples/manager/update-user-status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```javascript
import { Client, Manager } from "@appwrite.io/console";

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

const manager = new Manager(client);

const result = await manager.updateUserStatus({
status: false,
userId: '<USER_ID>', // optional
email: '<EMAIL>', // optional
reason: '<REASON>' // optional
});

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

const result = await organizations.createPlanEstimation({
organizationId: '<ORGANIZATION_ID>',
billingPlan: 'tier-0',
invites: [], // optional
couponId: '<COUPON_ID>' // optional
});

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/project/create-ephemeral-key.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Project, Scopes } 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.createEphemeralKey({
scopes: [Scopes.ProjectRead],
duration: 1
});

console.log(result);
```
2 changes: 1 addition & 1 deletion docs/examples/project/create-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const project = new Project(client);
const result = await project.createKey({
keyId: '<KEY_ID>',
name: '<NAME>',
scopes: [Scopes.SessionsWrite],
scopes: [Scopes.ProjectRead],
expire: '2020-10-15T06:38:00.000+00:00' // optional
});

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

const result = await projects.updateMockNumbers({
projectId: '<PROJECT_ID>',
numbers: []
const result = await project.createMockPhone({
number: '+12065550100',
otp: '<OTP>'
});

console.log(result);
Expand Down
15 changes: 15 additions & 0 deletions docs/examples/project/delete-mock-phone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```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.deleteMockPhone({
number: '+12065550100'
});

console.log(result);
```
13 changes: 13 additions & 0 deletions docs/examples/project/delete.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.delete();

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, 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 projects = new Projects(client);
const project = new Project(client);

const result = await projects.delete({
projectId: '<PROJECT_ID>'
const result = await project.getMockPhone({
number: '+12065550100'
});

console.log(result);
Expand Down
15 changes: 15 additions & 0 deletions docs/examples/project/get-o-auth-2-provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```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.getOAuth2Provider({
provider: '<PROVIDER>'
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/project/get-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Project, PolicyId } 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.getPolicy({
policyId: PolicyId.PasswordDictionary
});

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/project/list-email-templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```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.listEmailTemplates({
queries: [], // optional
total: false // optional
});

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/project/list-mock-phones.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```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.listMockPhones({
queries: [], // optional
total: false // optional
});

console.log(result);
```
13 changes: 13 additions & 0 deletions docs/examples/project/list-o-auth-2-providers.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.listOAuth2Providers();

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/project/list-policies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```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.listPolicies({
queries: [], // optional
total: false // optional
});

console.log(result);
```
Loading