Skip to content

Commit 20dc261

Browse files
committed
Appwrite 1.5 support
1 parent a7e0a24 commit 20dc261

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Client, Health } from "https://deno.land/x/appwrite/mod.ts";
2+
3+
const client = new Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2') // Your project ID
6+
.setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key
7+
8+
const health = new Health(client);
9+
10+
const response = await health.getQueueUsageDump(
11+
null // threshold (optional)
12+
);

src/services/health.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ export class Health extends Service {
512512
* @throws {AppwriteException}
513513
* @returns {Promise}
514514
*/
515-
async getQueueUsage(threshold?: number): Promise<Models.HealthQueue> {
515+
async getQueueUsageDump(threshold?: number): Promise<Models.HealthQueue> {
516516
const apiPath = '/health/queue/usage-dump';
517517
const payload: Payload = {};
518518

test/services/health.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,13 @@ describe('Health service', () => {
281281
});
282282

283283

284-
test('test method getQueueUsage()', async () => {
284+
test('test method getQueueUsageDump()', async () => {
285285
const data = {
286286
'size': 8,};
287287

288288
const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data)));
289289

290-
const response = await health.getQueueUsage(
290+
const response = await health.getQueueUsageDump(
291291
);
292292

293293
assertEquals(response, data);

0 commit comments

Comments
 (0)