Skip to content

feat: Console SDK update for version 2.3.1#60

Merged
ChiragAgg5k merged 1 commit intomainfrom
dev
Feb 17, 2026
Merged

feat: Console SDK update for version 2.3.1#60
ChiragAgg5k merged 1 commit intomainfrom
dev

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

@ChiragAgg5k ChiragAgg5k commented Feb 17, 2026

This PR contains updates to the Console SDK for version 2.3.1.

Summary by CodeRabbit

Release Notes v2.3.1

  • New Features

    • Introduced Activities API for accessing activity events
    • Added encryption option to database attributes and table columns
    • New ActivityEvent types for event tracking
  • Updates

    • Removed deprecated Deno runtime versions (1.21, 1.24, 1.35)
    • SDK version updated to 2.3.1
  • Documentation

    • Added Activities API usage examples
    • Added database and table attribute/column encryption examples with encrypt parameter

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 17, 2026

Walkthrough

This pull request represents a minor version bump from 2.3.0 to 2.3.1, introducing the Activities service for fetching activity events alongside encryption support for text-based database attributes and table columns. The release includes removal of three deprecated Deno runtime versions (1.21, 1.24, 1.35), adds new ActivityEvent models, and extends method signatures across the Databases and TablesDB services to support an optional encrypt parameter. Documentation examples are added for the new Activities API and updated across database example files to demonstrate the encryption capability.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: a version update from 2.3.1 to match the SDK release, covering version bumps, API enhancements (encrypt parameter), new Activities service, and enum removals.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/examples/activities/list-events.md`:
- Around line 10-12: The listEvents API's queries parameter is mismatched:
change the TypeScript signature in src/services/activities.ts from queries?:
string to queries?: string[] on the listEvents function, update any related
JSDoc/type comments to reflect "Array of query strings", and update the example
in docs/examples/activities/list-events.md to pass an array (e.g., queries:
['q1', 'q2']) instead of a single string so the docs match the corrected type
and other SDK services.

In `@src/services/activities.ts`:
- Around line 13-50: The listEvents overloads and normalization treat queries as
a single string; change all occurrences to use string[] (update the two method
signatures and the local params type to { queries?: string[] }) and adjust the
normalization in listEvents(paramsOrFirst) so it: 1) recognizes when
paramsOrFirst is an object (and not an array) and assigns params = paramsOrFirst
as { queries?: string[] }, 2) when paramsOrFirst is an array assign params = {
queries: paramsOrFirst as string[] }, and 3) when paramsOrFirst is a string
(deprecated path) assign params = { queries: [paramsOrFirst as string] };
finally ensure the local const queries is treated as string[] and
payload['queries'] = queries (so arrays serialize correctly). Use the existing
symbols listEvents, paramsOrFirst, params, queries, apiPath, payload to locate
and update the code.

Comment on lines +10 to +12
const result = await activities.listEvents({
queries: '' // optional
});
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 | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, let's locate the services directory and check type definitions
find . -type f -name "*.ts" | grep -E "(service|activity)" | head -20

Repository: appwrite/sdk-for-console

Length of output: 603


🏁 Script executed:

#!/bin/bash
# Search for queries parameter type definitions in TypeScript files
rg -n "queries\?:\s*string\[\]" --type=ts
rg -n "queries\?:\s*string" --type=ts | head -20

Repository: appwrite/sdk-for-console

Length of output: 50380


🏁 Script executed:

#!/bin/bash
# Read the documentation file to see current example
cat -n docs/examples/activities/list-events.md

Repository: appwrite/sdk-for-console

Length of output: 560


🏁 Script executed:

#!/bin/bash
# Search for listEvents in activities.ts
rg -n "listEvents" src/services/activities.ts -A 5

Repository: appwrite/sdk-for-console

Length of output: 955


🏁 Script executed:

#!/bin/bash
# Get the full definition context
head -100 src/services/activities.ts | tail -50

Repository: appwrite/sdk-for-console

Length of output: 1575


Fix the type definition and documentation example for listEvents queries parameter.

The listEvents method has inconsistent type definitions. The JSDoc states "Array of query strings," but the TypeScript signature defines queries as string, while every other service in the SDK uses string[]. The example should show an array once the type signature is corrected to match the documented intent and other services.

Suggested changes
  1. In src/services/activities.ts, update the type signature from queries?: string to queries?: string[]
  2. Update the documentation example:
-const result = await activities.listEvents({
-    queries: '' // optional
-});
+const result = await activities.listEvents({
+    queries: [] // optional
+});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/examples/activities/list-events.md` around lines 10 - 12, The listEvents
API's queries parameter is mismatched: change the TypeScript signature in
src/services/activities.ts from queries?: string to queries?: string[] on the
listEvents function, update any related JSDoc/type comments to reflect "Array of
query strings", and update the example in
docs/examples/activities/list-events.md to pass an array (e.g., queries: ['q1',
'q2']) instead of a single string so the docs match the corrected type and other
SDK services.

Comment on lines +13 to +50
/**
* List all events for selected filters.
*
* @param {string} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc.
* @throws {AppwriteException}
* @returns {Promise<Models.ActivityEventList>}
*/
listEvents(params?: { queries?: string }): Promise<Models.ActivityEventList>;
/**
* List all events for selected filters.
*
* @param {string} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc.
* @throws {AppwriteException}
* @returns {Promise<Models.ActivityEventList>}
* @deprecated Use the object parameter style method for a better developer experience.
*/
listEvents(queries?: string): Promise<Models.ActivityEventList>;
listEvents(
paramsOrFirst?: { queries?: string } | string
): Promise<Models.ActivityEventList> {
let params: { queries?: string };

if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
params = (paramsOrFirst || {}) as { queries?: string };
} else {
params = {
queries: paramsOrFirst as string
};
}

const queries = params.queries;


const apiPath = '/activities/events';
const payload: Payload = {};
if (typeof queries !== 'undefined') {
payload['queries'] = queries;
}
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 | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check queries parameter types across services
rg -n --type=ts "queries\?:\s*string\[\]" src/services | head -20
echo "---"
rg -n --type=ts "queries\?:\s*string\b" src/services | head -20

Repository: appwrite/sdk-for-console

Length of output: 5686


🏁 Script executed:

#!/bin/bash
# Also check the current listEvents implementation in activities.ts
cat -n src/services/activities.ts | head -60

Repository: appwrite/sdk-for-console

Length of output: 2922


Align queries typing with SDK standard string[] pattern.
The docstring describes an array of query strings, but the type signatures use string instead of string[]. All other services in the SDK (users, organizations, vcs) use string[] for queries. The current normalization logic at line 35 checks Array.isArray() but then treats it as the deprecated string path, which will serialize arrays incorrectly.

🛠️ Proposed fix
-    listEvents(params?: { queries?: string }): Promise<Models.ActivityEventList>;
+    listEvents(params?: { queries?: string[] }): Promise<Models.ActivityEventList>;
     /**
      * List all events for selected filters.
      *
-     * `@param` {string} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc.
+     * `@param` {string[]} queries - Array of query strings generated using the Query class provided by the SDK. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc.
      * `@throws` {AppwriteException}
      * `@returns` {Promise<Models.ActivityEventList>}
      * `@deprecated` Use the object parameter style method for a better developer experience.
      */
-    listEvents(queries?: string): Promise<Models.ActivityEventList>;
+    listEvents(queries?: string[]): Promise<Models.ActivityEventList>;
     listEvents(
-        paramsOrFirst?: { queries?: string } | string    
+        paramsOrFirst?: { queries?: string[] } | string[]    
     ): Promise<Models.ActivityEventList> {
-        let params: { queries?: string };
+        let params: { queries?: string[] };
         
-        if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
-            params = (paramsOrFirst || {}) as { queries?: string };
+        if (!paramsOrFirst || (typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
+            params = (paramsOrFirst || {}) as { queries?: string[] };
         } else {
             params = {
-                queries: paramsOrFirst as string            
+                queries: paramsOrFirst as string[]            
             };
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* List all events for selected filters.
*
* @param {string} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc.
* @throws {AppwriteException}
* @returns {Promise<Models.ActivityEventList>}
*/
listEvents(params?: { queries?: string }): Promise<Models.ActivityEventList>;
/**
* List all events for selected filters.
*
* @param {string} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc.
* @throws {AppwriteException}
* @returns {Promise<Models.ActivityEventList>}
* @deprecated Use the object parameter style method for a better developer experience.
*/
listEvents(queries?: string): Promise<Models.ActivityEventList>;
listEvents(
paramsOrFirst?: { queries?: string } | string
): Promise<Models.ActivityEventList> {
let params: { queries?: string };
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
params = (paramsOrFirst || {}) as { queries?: string };
} else {
params = {
queries: paramsOrFirst as string
};
}
const queries = params.queries;
const apiPath = '/activities/events';
const payload: Payload = {};
if (typeof queries !== 'undefined') {
payload['queries'] = queries;
}
/**
* List all events for selected filters.
*
* `@param` {string} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc.
* `@throws` {AppwriteException}
* `@returns` {Promise<Models.ActivityEventList>}
*/
listEvents(params?: { queries?: string[] }): Promise<Models.ActivityEventList>;
/**
* List all events for selected filters.
*
* `@param` {string[]} queries - Array of query strings generated using the Query class provided by the SDK. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc.
* `@throws` {AppwriteException}
* `@returns` {Promise<Models.ActivityEventList>}
* `@deprecated` Use the object parameter style method for a better developer experience.
*/
listEvents(queries?: string[]): Promise<Models.ActivityEventList>;
listEvents(
paramsOrFirst?: { queries?: string[] } | string[]
): Promise<Models.ActivityEventList> {
let params: { queries?: string[] };
if (!paramsOrFirst || (typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
params = (paramsOrFirst || {}) as { queries?: string[] };
} else {
params = {
queries: paramsOrFirst as string[]
};
}
const queries = params.queries;
const apiPath = '/activities/events';
const payload: Payload = {};
if (typeof queries !== 'undefined') {
payload['queries'] = queries;
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/services/activities.ts` around lines 13 - 50, The listEvents overloads
and normalization treat queries as a single string; change all occurrences to
use string[] (update the two method signatures and the local params type to {
queries?: string[] }) and adjust the normalization in listEvents(paramsOrFirst)
so it: 1) recognizes when paramsOrFirst is an object (and not an array) and
assigns params = paramsOrFirst as { queries?: string[] }, 2) when paramsOrFirst
is an array assign params = { queries: paramsOrFirst as string[] }, and 3) when
paramsOrFirst is a string (deprecated path) assign params = { queries:
[paramsOrFirst as string] }; finally ensure the local const queries is treated
as string[] and payload['queries'] = queries (so arrays serialize correctly).
Use the existing symbols listEvents, paramsOrFirst, params, queries, apiPath,
payload to locate and update the code.

@ChiragAgg5k ChiragAgg5k merged commit 96d04e8 into main Feb 17, 2026
2 checks passed
@ChiragAgg5k ChiragAgg5k deleted the dev branch February 17, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants