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

## 21.4.0

* Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance
* Add `Operator` class for atomic modification of rows via update, bulk update, upsert, and bulk upsert operations

## 21.3.0

* Add new `Realtime` service with methods for subscribing to channels and receiving messages
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { Client, Account } from "appwrite";
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@21.3.0"></script>
<script src="https://cdn.jsdelivr.net/npm/appwrite@21.4.0"></script>
```


Expand Down
3 changes: 2 additions & 1 deletion docs/examples/account/list-identities.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const client = new Client()
const account = new Account(client);

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

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

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

console.log(result);
4 changes: 2 additions & 2 deletions docs/examples/databases/create-document.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, Databases } from "appwrite";
import { Client, Databases, Permission, Role } from "appwrite";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -17,7 +17,7 @@ const result = await databases.createDocument({
"age": 30,
"isAdmin": false
},
permissions: ["read("any")"], // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: '<TRANSACTION_ID>' // optional
});

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/databases/list-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const result = await databases.listDocuments({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [], // optional
transactionId: '<TRANSACTION_ID>' // optional
transactionId: '<TRANSACTION_ID>', // optional
total: false // optional
});

console.log(result);
4 changes: 2 additions & 2 deletions docs/examples/databases/update-document.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, Databases } from "appwrite";
import { Client, Databases, Permission, Role } from "appwrite";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -11,7 +11,7 @@ const result = await databases.updateDocument({
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {}, // optional
permissions: ["read("any")"], // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: '<TRANSACTION_ID>' // optional
});

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/upsert-document.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, Databases } from "appwrite";
import { Client, Databases, Permission, Role } from "appwrite";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -11,7 +11,7 @@ const result = await databases.upsertDocument({
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {},
permissions: ["read("any")"], // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: '<TRANSACTION_ID>' // optional
});

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/functions/list-executions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const functions = new Functions(client);

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

console.log(result);
4 changes: 2 additions & 2 deletions docs/examples/storage/create-file.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, Storage } from "appwrite";
import { Client, Storage, Permission, Role } from "appwrite";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -10,7 +10,7 @@ const result = await storage.createFile({
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
file: document.getElementById('uploader').files[0],
permissions: ["read("any")"] // optional
permissions: [Permission.read(Role.any())] // optional
});

console.log(result);
3 changes: 2 additions & 1 deletion docs/examples/storage/list-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const storage = new Storage(client);
const result = await storage.listFiles({
bucketId: '<BUCKET_ID>',
queries: [], // optional
search: '<SEARCH>' // optional
search: '<SEARCH>', // optional
total: false // optional
});

console.log(result);
4 changes: 2 additions & 2 deletions docs/examples/storage/update-file.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, Storage } from "appwrite";
import { Client, Storage, Permission, Role } from "appwrite";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -10,7 +10,7 @@ const result = await storage.updateFile({
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
name: '<NAME>', // optional
permissions: ["read("any")"] // optional
permissions: [Permission.read(Role.any())] // optional
});

console.log(result);
4 changes: 2 additions & 2 deletions docs/examples/tablesdb/create-row.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, TablesDB } from "appwrite";
import { Client, TablesDB, Permission, Role } from "appwrite";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -17,7 +17,7 @@ const result = await tablesDB.createRow({
"age": 30,
"isAdmin": false
},
permissions: ["read("any")"], // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: '<TRANSACTION_ID>' // optional
});

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/list-rows.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const result = await tablesDB.listRows({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
queries: [], // optional
transactionId: '<TRANSACTION_ID>' // optional
transactionId: '<TRANSACTION_ID>', // optional
total: false // optional
});

console.log(result);
4 changes: 2 additions & 2 deletions docs/examples/tablesdb/update-row.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, TablesDB } from "appwrite";
import { Client, TablesDB, Permission, Role } from "appwrite";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -11,7 +11,7 @@ const result = await tablesDB.updateRow({
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
data: {}, // optional
permissions: ["read("any")"], // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: '<TRANSACTION_ID>' // optional
});

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/tablesdb/upsert-row.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, TablesDB } from "appwrite";
import { Client, TablesDB, Permission, Role } from "appwrite";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -11,7 +11,7 @@ const result = await tablesDB.upsertRow({
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
data: {}, // optional
permissions: ["read("any")"], // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: '<TRANSACTION_ID>' // optional
});

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/teams/list-memberships.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const teams = new Teams(client);
const result = await teams.listMemberships({
teamId: '<TEAM_ID>',
queries: [], // optional
search: '<SEARCH>' // optional
search: '<SEARCH>', // optional
total: false // optional
});

console.log(result);
3 changes: 2 additions & 1 deletion docs/examples/teams/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const teams = new Teams(client);

const result = await teams.list({
queries: [], // optional
search: '<SEARCH>' // optional
search: '<SEARCH>', // optional
total: false // optional
});

console.log(result);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "appwrite",
"homepage": "https://appwrite.io/support",
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
"version": "21.3.0",
"version": "21.4.0",
"license": "BSD-3-Clause",
"main": "dist/cjs/sdk.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class Client {
'x-sdk-name': 'Web',
'x-sdk-platform': 'client',
'x-sdk-language': 'web',
'x-sdk-version': '21.3.0',
'x-sdk-version': '21.4.0',
'X-Appwrite-Response-Format': '1.8.0',
};

Expand Down
1 change: 1 addition & 0 deletions src/enums/execution-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export enum ExecutionStatus {
Processing = 'processing',
Completed = 'completed',
Failed = 'failed',
Scheduled = 'scheduled',
}
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export type { QueryTypes, QueryTypesList } from './query';
export { Permission } from './permission';
export { Role } from './role';
export { ID } from './id';
export { Operator, Condition } from './operator';
export { AuthenticatorType } from './enums/authenticator-type';
export { AuthenticationFactor } from './enums/authentication-factor';
export { OAuthProvider } from './enums/o-auth-provider';
Expand All @@ -31,3 +32,5 @@ export { Flag } from './enums/flag';
export { ExecutionMethod } from './enums/execution-method';
export { ImageGravity } from './enums/image-gravity';
export { ImageFormat } from './enums/image-format';
export { ExecutionTrigger } from './enums/execution-trigger';
export { ExecutionStatus } from './enums/execution-status';
2 changes: 1 addition & 1 deletion src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ export namespace Models {
*/
trigger: ExecutionTrigger;
/**
* The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.
* The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, `failed`, or `scheduled`.
*/
status: ExecutionStatus;
/**
Expand Down
Loading