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

## 12.2.0

* Added: Introduced `bigint` create/update APIs for legacy Databases attributes
* Added: Introduced `bigint` create/update APIs for `TablesDB` columns
* Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret`

## 12.1.0

* Added: `setSession` method on `Client` for `X-Appwrite-Session` authentication
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-1.9.3-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.4-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 is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).**
**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).**

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


Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/create-program-membership.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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 console = new Console(client);

const result = await xconsole.createProgramMembership({
const result = await console.createProgramMembership({
programId: '<PROGRAM_ID>'
});

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/create-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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 console = new Console(client);

const result = await xconsole.createSource({
const result = await console.createSource({
ref: '<REF>', // optional
referrer: 'https://example.com', // optional
utmSource: '<UTM_SOURCE>', // optional
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/get-campaign.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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 console = new Console(client);

const result = await xconsole.getCampaign({
const result = await console.getCampaign({
campaignId: '<CAMPAIGN_ID>'
});

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/get-coupon.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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 console = new Console(client);

const result = await xconsole.getCoupon({
const result = await console.getCoupon({
couponId: '<COUPON_ID>'
});

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/get-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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 console = new Console(client);

const result = await xconsole.getPlan({
const result = await console.getPlan({
planId: '<PLAN_ID>'
});

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/get-plans.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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 console = new Console(client);

const result = await xconsole.getPlans({
const result = await console.getPlans({
platform: Platform.Appwrite // optional
});

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/get-program.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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 console = new Console(client);

const result = await xconsole.getProgram({
const result = await console.getProgram({
programId: '<PROGRAM_ID>'
});

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/get-resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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 console = new Console(client);

const result = await xconsole.getResource({
const result = await console.getResource({
value: '<VALUE>',
type: ConsoleResourceType.Rules
});
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/list-o-auth-2-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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 console = new Console(client);

const result = await xconsole.listOAuth2Providers();
const result = await console.listOAuth2Providers();

console.log(result);
```
4 changes: 2 additions & 2 deletions docs/examples/console/list-project-scopes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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 console = new Console(client);

const result = await xconsole.listProjectScopes();
const result = await console.listProjectScopes();

console.log(result);
```
4 changes: 2 additions & 2 deletions docs/examples/console/list-regions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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 console = new Console(client);

const result = await xconsole.listRegions();
const result = await console.listRegions();

console.log(result);
```
4 changes: 2 additions & 2 deletions docs/examples/console/suggest-columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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 console = new Console(client);

const result = await xconsole.suggestColumns({
const result = await console.suggestColumns({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
context: '<CONTEXT>', // optional
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/suggest-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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 console = new Console(client);

const result = await xconsole.suggestIndexes({
const result = await console.suggestIndexes({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
min: 1, // optional
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/suggest-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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 console = new Console(client);

const result = await xconsole.suggestQueries({
const result = await console.suggestQueries({
resource: QuerySuggestionResource.Activities,
input: '<INPUT>',
databaseId: '<DATABASE_ID>', // optional
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/console/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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 console = new Console(client);

const result = await xconsole.variables();
const result = await console.variables();

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

const result = await databases.createBigIntAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
min: null, // optional
max: null, // optional
default: null, // optional
array: false // optional
});

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

const result = await databases.updateBigIntAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: null,
min: null, // optional
max: null, // optional
newKey: '' // optional
});

console.log(result);
```
1 change: 1 addition & 0 deletions docs/examples/functions/create-variable.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.createVariable({
functionId: '<FUNCTION_ID>',
variableId: '<VARIABLE_ID>',
key: '<KEY>',
value: '<VALUE>',
secret: false // optional
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/functions/list-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const client = new Client()
const functions = new Functions(client);

const result = await functions.listVariables({
functionId: '<FUNCTION_ID>'
functionId: '<FUNCTION_ID>',
queries: [], // optional
total: false // optional
});

console.log(result);
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/functions/update-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const functions = new Functions(client);
const result = await functions.updateVariable({
functionId: '<FUNCTION_ID>',
variableId: '<VARIABLE_ID>',
key: '<KEY>',
key: '<KEY>', // optional
value: '<VALUE>', // optional
secret: false // optional
});
Expand Down
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, Range } 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: Range.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);
```
Loading
Loading