Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
92 changes: 92 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 3.0.1

* Fix very large double values (for example 1.7976931348623157e+308) from being expanded into giant integer literals
Comment on lines +3 to +5
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Tone tweak: avoid “very”.

Line 5: consider removing or replacing “very” for a cleaner changelog entry.

🧰 Tools
🪛 LanguageTool

[style] ~5-~5: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: # Change Log ## 3.0.1 * Fix very large double values (for example 1.7976931348...

(EN_WEAK_ADJECTIVE)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` around lines 3 - 5, The changelog entry under "## 3.0.1" uses
the word "very" which should be removed for a cleaner tone; update the sentence
"Fix very large double values (for example 1.7976931348623157e+308) from being
expanded into giant integer literals" to read e.g. "Fix large double values (for
example 1.7976931348623157e+308) from being expanded into giant integer
literals" (or another concise adjective) so the entry under the heading "##
3.0.1" no longer contains "very".


## 3.0.0

* Breaking: EmailTemplateType enum values renamed and updated (Magicsession -> MagicSession, Mfachallenge -> MfaChallenge, Sessionalert -> SessionAlert, Otpsession -> OtpSession) and their underlying string values changed accordingly, which may affect existing integrations.
Expand Down Expand Up @@ -100,3 +104,91 @@ Fix bigint and float parsing in SDK.
## 1.5.0

* Adds support for `databasesReadsTotal` and `databasesWritesTotal` attributes

## 22.3.1

* Add `upsert` method to Realtime `Channels` helper class
* Fix `bignumber.js` bundler conflict with Next.js Turbopack by removing direct dependency in favor of transitive dependency from `json-bigint`

## 22.1.0

* Add `queries` parameter to `Realtime.subscribe()` and `client.subscribe()` for server-side query filtering
* Add slot-based subscription management with subscription ID mappings from backend
* Add `subscriptions` field to `RealtimeResponseEvent` type
* Fix `Roles` enum removed from Teams service; `roles` parameter now accepts `string[]`
* Fix parameter detection in overloaded methods to check for optional params (Account, Avatars, Graphql)
* Fix WebSocket connection handling with stale connection guards and improved close/reconnect logic
* Fix doc examples wrapped in markdown code fences
Comment on lines +115 to +121
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Capitalize “Markdown”.

Line 121: use “Markdown” (proper noun) instead of “markdown”.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~121-~121: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ...ect logic * Fix doc examples wrapped in markdown code fences ## 22.0.0 * Add array-bas...

(MARKDOWN_NNP)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` around lines 115 - 121, The bullet "Fix doc examples wrapped in
markdown code fences" uses lowercase "markdown"; update that entry to use the
proper noun "Markdown" (i.e., change "markdown" to "Markdown") so the changelog
line reads "Fix doc examples wrapped in Markdown code fences" — locate the line
with the exact phrase "Fix doc examples wrapped in markdown code fences" in
CHANGELOG.md and correct the capitalization.


## 22.0.0

* Add array-based enum parameters (e.g., `permissions: BrowserPermission[]`).
* Breaking change: `Output` enum has been removed; use `ImageFormat` instead.
* Add `Channel` helpers for Realtime.

## 21.5.0

* Add `getScreenshot` method to `Avatars` service
* Add `Theme`, `Timezone` and `Output` enums

## 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
* Fix `client.setSession` not working when using realtime
* Deprecate `client.subscribe` method in favor of `Realtime` service

> Note: Deprecated methods are still available for backwards compatibility, but might be removed in future versions.

## 21.2.1

* Add transaction support for Databases and TablesDB

## 21.1.0

* Deprecate `createVerification` method in `Account` service
* Add `createEmailVerification` method in `Account` service

## 18.2.0

* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service
* Add `gif` support to `ImageFormat` enum
* Fix undefined `fileParam` error in `chunkedUpload` method
* Fix autocompletion not working for `Document` model even when generic is passed

## 18.1.1

* Fix using `devKeys` resulting in an error by conditionally removing credentials

## 18.1.0

* Add `devKeys` support to `Client` service
* Add `upsertDocument` support to `Databases` service

## 18.0.0

* Add `<REGION>` to doc examples due to the new multi region endpoints
* Remove `Gif` from ImageFormat enum
Comment on lines +172 to +175
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Hyphenate “multi-region”.

Line 174: “multi-region” is the standard compound form.

🧰 Tools
🪛 LanguageTool

[grammar] ~174-~174: Use a hyphen to join words.
Context: ...N>to doc examples due to the new multi region endpoints * RemoveGif` from Ima...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` around lines 172 - 175, Update the release note under the "##
18.0.0" section: change the phrase "multi region endpoints" to hyphenated
"multi-region endpoints" in the line that mentions adding `<REGION>` to doc
examples (the same line referencing the new multi-region endpoints and the
ImageFormat enum change).

* Remove `search` param from `listExecutions` method
* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage
* Improve CORS error catching in `client.call` method

## 17.0.2

* Fix requests failing by removing `Content-Type` header from `GET` and `HEAD` requests

## 17.0.1

* Remove unnecessary titles from method descriptions
* Fix duplicate adding of payload params
* Remove unnecessary awaits and asyncs
* Ensure `AppwriteException` response is always string

## 17.0.0

* Fix pong response & chunked upload
* Add `ping` support to `Realtime` service
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.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@3.0.0"></script>
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@3.0.1"></script>
```


Expand Down
25 changes: 25 additions & 0 deletions docs/examples/domains/create-purchase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
```javascript
import { Client, Domains } 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 domains = new Domains(client);

const result = await domains.createPurchase({
domain: '',
teamId: '<TEAM_ID>',
Comment on lines +10 to +12
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use a placeholder domain instead of an empty string.

Line 11 currently uses domain: '', which can be misleading in copy/paste usage. Consider a placeholder like <DOMAIN> or a sample such as example.com.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/domains/create-purchase.md` around lines 10 - 12, The example
uses an empty string for the domain which is misleading; update the
domains.createPurchase call to use a clear placeholder or sample value (e.g.,
"<DOMAIN>" or "example.com") instead of '', changing the domain field in the
createPurchase example to the chosen placeholder so copy/paste users see a valid
value for the domain parameter in the domains.createPurchase invocation.

firstName: '<FIRST_NAME>',
lastName: '<LAST_NAME>',
email: 'email@example.com',
phone: '+12065550100',
billingAddressId: '<BILLING_ADDRESS_ID>',
paymentMethodId: '<PAYMENT_METHOD_ID>',
addressLine3: '<ADDRESS_LINE3>', // optional
companyName: '<COMPANY_NAME>', // optional
periodYears: 1 // optional
});

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

const result = await organizations.getScopes({
organizationId: '<ORGANIZATION_ID>'
organizationId: '<ORGANIZATION_ID>',
projectId: '<PROJECT_ID>' // optional
});

console.log(result);
Expand Down
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.io/console",
"homepage": "https://appwrite.io/support",
"description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
"version": "3.0.0",
"version": "3.0.1",
"license": "BSD-3-Clause",
"main": "dist/cjs/sdk.js",
"exports": {
Expand Down
9 changes: 7 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const JSONbigSerializer = JSONbigModule({ useNativeBigInt: true });

const MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
const MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
const MAX_INT64 = BigInt('9223372036854775807');
const MIN_INT64 = BigInt('-9223372036854775808');

function isBigNumber(value: any): boolean {
return value !== null
Expand All @@ -25,7 +27,10 @@ function reviver(_key: string, value: any): any {
if (bi >= MIN_SAFE && bi <= MAX_SAFE) {
return Number(str);
}
return bi;
if (bi >= MIN_INT64 && bi <= MAX_INT64) {
return bi;
}
return value.toNumber();
}
return value.toNumber();
}
Expand Down Expand Up @@ -395,7 +400,7 @@ class Client {
'x-sdk-name': 'Console',
'x-sdk-platform': 'console',
'x-sdk-language': 'web',
'x-sdk-version': '3.0.0',
'x-sdk-version': '3.0.1',
'X-Appwrite-Response-Format': '1.8.0',
};

Expand Down
6 changes: 5 additions & 1 deletion src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8567,6 +8567,10 @@ export namespace Models {
* Domain registrar (e.g. "appwrite" or "third_party").
*/
registrar: string;
/**
* Payment status for domain purchase.
*/
paymentStatus: string;
/**
* Nameservers setting. "Appwrite" or empty string.
*/
Expand All @@ -8584,7 +8588,7 @@ export namespace Models {
*/
autoRenewal: boolean;
/**
* Renewal price (in USD).
* Renewal price (in cents).
*/
renewalPrice: number;
/**
Expand Down
26 changes: 26 additions & 0 deletions src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,40 @@ export class Query {

/**
* Filter resources where attribute contains the specified value.
* For string attributes, checks if the string contains the substring.
*
* Note: For array attributes, use {@link containsAny} or {@link containsAll} instead.
* @param {string} attribute
* @param {string | string[]} value
* @returns {string}
*/
static contains = (attribute: string, value: string | any[]): string =>
new Query("contains", attribute, value).toString();

/**
* Filter resources where attribute contains ANY of the specified values.
* For array and relationship attributes, matches documents where the attribute
* contains at least one of the given values.
*
* @param {string} attribute
* @param {any[]} value
* @returns {string}
*/
static containsAny = (attribute: string, value: any[]): string =>
new Query("containsAny", attribute, value).toString();

/**
* Filter resources where attribute contains ALL of the specified values.
* For array and relationship attributes, matches documents where the attribute
* contains every one of the given values.
*
* @param {string} attribute
* @param {any[]} value
* @returns {string}
*/
static containsAll = (attribute: string, value: any[]): string =>
new Query("containsAll", attribute, value).toString();

/**
* Filter resources where attribute does not contain the specified value.
*
Expand Down
Loading