Skip to content

1.6.x #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 17, 2025
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Appwrite Deno SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-deno.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.6.2-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
4 changes: 2 additions & 2 deletions docs/examples/databases/update-float-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const response = await databases.updateFloatAttribute(
'<COLLECTION_ID>', // collectionId
'', // key
false, // required
null, // min
null, // max
null, // default
null, // min (optional)
null, // max (optional)
'' // newKey (optional)
);
4 changes: 2 additions & 2 deletions docs/examples/databases/update-integer-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const response = await databases.updateIntegerAttribute(
'<COLLECTION_ID>', // collectionId
'', // key
false, // required
null, // min
null, // max
null, // default
null, // min (optional)
null, // max (optional)
'' // newKey (optional)
);
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ const client = new Client()

const health = new Health(client);

const response = await health.getQueueUsageDump(
const response = await health.getQueueStatsResources(
null // threshold (optional)
);
10 changes: 0 additions & 10 deletions docs/examples/health/get-queue.md

This file was deleted.

11 changes: 7 additions & 4 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export class Client {
endpoint: string = 'https://cloud.appwrite.io/v1';
headers: Payload = {
'content-type': '',
'user-agent' : `AppwriteDenoSDK/13.0.0 (${Deno.build.os}; ${Deno.build.arch})`,
'user-agent' : `AppwriteDenoSDK/14.0.0 (${Deno.build.os}; ${Deno.build.arch})`,
'x-sdk-name': 'Deno',
'x-sdk-platform': 'server',
'x-sdk-language': 'deno',
'x-sdk-version': '13.0.0',
'x-sdk-version': '14.0.0',
'X-Appwrite-Response-Format':'1.6.0',
};

Expand Down Expand Up @@ -113,8 +113,11 @@ export class Client {
* @return this
*/
setEndpoint(endpoint: string): this {
this.endpoint = endpoint;
if (!endpoint.startsWith('http://') && !endpoint.startsWith('https://')) {
throw new AppwriteException('Invalid endpoint URL: ' + endpoint);
}

this.endpoint = endpoint;
return this;
}

Expand Down Expand Up @@ -180,7 +183,7 @@ export class Client {
} catch (error) {
throw new AppwriteException(text, response.status, "", text);
}
throw new AppwriteException(json.message, json.code, json.type, json);
throw new AppwriteException(json.message, json.code, json.type, text);
}

if (responseType === "arraybuffer") {
Expand Down
1 change: 1 addition & 0 deletions src/enums/credit-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ export enum CreditCard {
Visa = 'visa',
MIR = 'mir',
Maestro = 'maestro',
Rupay = 'rupay',
}
4 changes: 2 additions & 2 deletions src/enums/name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export enum Name {
V1Audits = 'v1-audits',
V1Mails = 'v1-mails',
V1Functions = 'v1-functions',
V1Usage = 'v1-usage',
V1UsageDump = 'v1-usage-dump',
V1StatsResources = 'v1-stats-resources',
V1StatsUsage = 'v1-stats-usage',
V1Webhooks = 'v1-webhooks',
V1Certificates = 'v1-certificates',
V1Builds = 'v1-builds',
Expand Down
1 change: 1 addition & 0 deletions src/enums/o-auth-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export enum OAuthProvider {
Dropbox = 'dropbox',
Etsy = 'etsy',
Facebook = 'facebook',
Figma = 'figma',
Github = 'github',
Gitlab = 'gitlab',
Google = 'google',
Expand Down
Loading