Skip to content

feat: Node.js SDK update for version 30.0.1 - #177

Merged
ChiragAgg5k merged 13 commits into
mainfrom
dev
Oct 15, 2026
Merged

ChiragAgg5k merged 13 commits into
mainfrom
dev

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

This PR contains updates to the SDK for version 30.0.1.

What's Changed

  • Breaking: requests send X-Appwrite-Response-Format: 2.5.0; responses follow the 2.5 shapes
  • Breaking: removed account.listLogs, users.listLogs and the Models.Log/Models.LogList models
  • Breaking: removed organization.createKey, getKey, listKeys, updateKey and deleteKey, and OrganizationKeyScopes; use organization.listProjectKeys, getProjectKey, updateProjectKey and deleteProjectKey instead
  • Breaking: removed Client.setDevKey, Models.DevKey and Project.devKeys
  • Breaking: removed BillingPlanGroup.Starter; use BillingPlanGroup.Free
  • Breaking: listSpecifications returns each specification's prices and overage rates on the row itself. Removed the list-level pricing field and the DedicatedDatabaseSpecificationPricing model
  • Breaking: removed Block fields reason, projectName, region, organizationName, organizationId and billingPlan
  • Breaking: OAuth2 resource params now take string[]
  • Breaking: project.updateOAuth2Kakao takes enabled before prompt
  • Breaking: BackupRestoration.options is now an object
  • Breaking: nullable response fields are typed T | null; some became optional, such as BillingPlan.usage
  • Added: Topic helper to build MQTT topics for push messages
  • Added: mongo, mysql and postgresql promoteRestoration, restoreMode, targetName and autoPromote on createRestoration, and DedicatedDatabaseRestoration.restoreMode
  • Added: proxy.createSMTPRule, the ProxyRuleProtocol enum and ProxyRule.protocol
  • Added: emailEnabled on functions.update and Function, and ExecutionTrigger.Email
  • Added: Query aggregates (count, countDistinct, sum, avg, min, max and more), groupBy, having, distinct, joins, relationship, covers, spatialEquals and page
  • Added: Query.builder() to chain queries into a list
  • Updated: nullable request params accept null, such as qos on topics and the Appwrite provider
  • Updated: missing response fields fall back to their documented defaults
  • Updated: OAuth2 prompt and native fields, PlatformAndroid.fingerprints and Identity.providerIdToken are always returned
  • Fixed: list and object defaults filled into a response are copied per model, and object defaults are {} instead of []

@ChiragAgg5k ChiragAgg5k changed the title feat: Node.js SDK update for version 30.0.0 feat: SDK update for version 30.0.0 Oct 14, 2026
@ChiragAgg5k ChiragAgg5k changed the title feat: SDK update for version 30.0.0 feat: Node.js SDK update for version 30.0.0 Oct 14, 2026
@hansi-codes

hansi-codes Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

🟡 Tier B · Needs changes before merging

The outstanding query-builder parameter typing and undocumented wildcard Topic API removal still need resolution.

Updates the Node.js SDK to 30.0.1 and targets Appwrite response format 2.5.0. It adds query-building and topic helpers, updates service APIs and response models, and adds examples and tests for the expanded SDK surface.

56 of 143 changed files were too large to include in full.

Verdict New comments Fixed Still open
💬 Commented 1 1 2

Note

Not approving while a bug finding is open: Accept query builders in service query parameter types

Finding Where
🟡 Add coverage for default filling and per-model copies src/client.ts:99
Fix with agent prompt
### Issue 1
src/client.ts:99-102
**Add coverage for default filling and per-model copies**

The new defaults path changes responses with omitted fields and is intended to give each model independent nested defaults, but the existing and added tests do not exercise either case. A focused test would catch regressions that can leave fields absent or let a mutation on one returned model affect another.

### Issue 2
src/query.ts:976
**Accept query builders in service query parameter types**

The new request normalization handles `Query.Builder` values, but service methods such as `TablesDB.listRows` still declare `queries` as `string[]`. TypeScript callers therefore cannot pass the builder values supported by the new runtime path without a cast; update the query-bearing service parameter types and overloads to accept `QueryInput`. 

### Issue 3
src/index.ts:44
**Document the removed wildcard Topic API**

This release removes `Topic.any()`/`.all()` and the `ResolvedTopic` export that were available in 30.0.0-rc.2, so existing wildcard-topic code now fails to compile or throws at runtime. Since the v30 breaking-changes list does not mention this removal, please retain the API or document this incompatibility.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
📂 Walkthrough · 6
File Change
CHANGELOG.md, README.md, docs/examples/** Documents the 30.0.1 API updates and adds or updates usage examples.
package.json, package-lock.json Updates package metadata to version 30.0.1; locked dependency versions remain unchanged.
src/client.ts, src/query.ts, src/topic.ts, src/index.ts Adds response-default handling and query/topic helpers, and updates public exports and request headers.
src/models.ts, src/services/*.ts Updates response models and service endpoints for the 2.5 API.
src/enums/*.ts Adds API enum values and new enum exports.
test/**/*.js Updates service and query tests for the new SDK behavior.
⏳ Still open from earlier reviews · 2
✅ Fixed since the last review · 1
  • Nested query arrays bypass normalization · src/query.ts:1455

Reviewed a8e771a · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Tier A · See the inline comments. Summary

src/client.ts:82-82

Clone mutable defaults for each returned model

Spreading model.defaults is shallow, so repeated response items missing an array field receive the same array instance. Mutating that field on one returned item then changes the other items too; clone mutable default values per model.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/client.ts
Line: 82

Comment:
**Clone mutable defaults for each returned model**

Spreading `model.defaults` is shallow, so repeated response items missing an array field receive the same array instance. Mutating that field on one returned item then changes the other items too; clone mutable default values per model.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · bug · Reply if this doesn't apply.


src/services/backups.ts:1005-1005

Keep restoration options object-shaped

BackupRestoration.options is typed and documented as an object, but this missing-field fallback supplies an array. When a response omits options, callers receive the wrong shape; the same fallback is repeated for restoration list and get responses.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/services/backups.ts
Line: 1005

Comment:
**Keep restoration options object-shaped**

`BackupRestoration.options` is typed and documented as an object, but this missing-field fallback supplies an array. When a response omits `options`, callers receive the wrong shape; the same fallback is repeated for restoration list and get responses.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · bug · Reply if this doesn't apply.


src/services/waf.ts:294-294

Keep WAF rule config object-shaped

WAF rule models define config as an object, but this fallback supplies an array. A response missing config therefore violates the returned model contract; the same default is used by the other WAF rule response handlers.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/services/waf.ts
Line: 294

Comment:
**Keep WAF rule config object-shaped**

WAF rule models define `config` as an object, but this fallback supplies an array. A response missing `config` therefore violates the returned model contract; the same default is used by the other WAF rule response handlers.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · bug · Reply if this doesn't apply.


src/services/project.ts:77-77

Keep project onboarding object-shaped

The Project model defines onboarding as an object, but this fallback supplies an array. When a project response omits the field, callers get the wrong shape; the same fallback appears in the other project response defaults.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/services/project.ts
Line: 77

Comment:
**Keep project onboarding object-shaped**

The `Project` model defines `onboarding` as an object, but this fallback supplies an array. When a project response omits the field, callers get the wrong shape; the same fallback appears in the other project response defaults.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · bug · Reply if this doesn't apply.


src/services/advisor.ts:146-146

Keep CTA params object-shaped

InsightCTA.params is an object parameter map, but its missing-field fallback is an array. A CTA returned without params will consequently expose the wrong shape; this default is repeated for the other insight response methods.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/services/advisor.ts
Line: 146

Comment:
**Keep CTA params object-shaped**

`InsightCTA.params` is an object parameter map, but its missing-field fallback is an array. A CTA returned without `params` will consequently expose the wrong shape; this default is repeated for the other insight response methods.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · bug · Reply if this doesn't apply.


src/services/messaging.ts:119-119

Keep message data object-shaped

The Message model defines data as an object, but this fallback supplies an array. Responses omitting the field will return the wrong shape to consumers expecting keyed message data; the same default is repeated across message response methods.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/services/messaging.ts
Line: 119

Comment:
**Keep message data object-shaped**

The `Message` model defines `data` as an object, but this fallback supplies an array. Responses omitting the field will return the wrong shape to consumers expecting keyed message data; the same default is repeated across message response methods.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · bug · Reply if this doesn't apply.


src/services/messaging.ts:2376-2376

Keep provider credentials object-shaped

Provider models define credentials as an object, but this fallback supplies an array. When a provider response omits credentials, callers receive the wrong shape; this default is repeated across provider response methods.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/services/messaging.ts
Line: 2376

Comment:
**Keep provider credentials object-shaped**

Provider models define `credentials` as an object, but this fallback supplies an array. When a provider response omits `credentials`, callers receive the wrong shape; this default is repeated across provider response methods.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · bug · Reply if this doesn't apply.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Tier A · See the inline comments. Summary

Comment thread src/query.ts
}
}

export type QueryInput = string | Query | Query.Builder | QueryInput[];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Accept query builders in service query parameter types

The new request normalization handles Query.Builder values, but service methods such as TablesDB.listRows still declare queries as string[]. TypeScript callers therefore cannot pass the builder values supported by the new runtime path without a cast; update the query-bearing service parameter types and overloads to accept QueryInput.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/query.ts
Line: 976

Comment:
**Accept query builders in service query parameter types**

The new request normalization handles `Query.Builder` values, but service methods such as `TablesDB.listRows` still declare `queries` as `string[]`. TypeScript callers therefore cannot pass the builder values supported by the new runtime path without a cast; update the query-bearing service parameter types and overloads to accept `QueryInput`. 

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · bug · Reply if this doesn't apply.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Intentional for this release: service queries params stay string[] and the documented path is Query.builder()...build(). Widening every query-bearing param to accept builders needs the spec to mark those params, which it does not today, so it is a follow-up rather than part of this major.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

build() is a documented workaround, but the type/runtime mismatch remains: flattenParam recognizes and normalizes Query.Builder values (query.ts), and the client applies it to request parameters (client.ts). Yet TablesDB.listTables accepts only string[] in its parameter object and overloads (tables-db.ts). TypeScript callers therefore can’t use the builder directly even though the runtime handles it. Please widen the query parameter types and overloads to accept QueryInput.

@ChiragAgg5k

Copy link
Copy Markdown
Member Author

All seven fixed in the generator (appwrite/sdk-generator#2046) and regenerated here. Map fields the spec defaults to {} (restoration options, WAF config, project onboarding, CTA params, message data, provider credentials) now fall back to {} instead of [], and each returned item gets its own copy of a filled-in list or object, so mutating one no longer changes its siblings.

@ChiragAgg5k

Copy link
Copy Markdown
Member Author

@hansi-codes review

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Tier A · See the inline comments. Summary

Comment thread src/query.ts Outdated
@ChiragAgg5k

Copy link
Copy Markdown
Member Author

@hansi-codes review

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Tier B · See the inline comments. Summary

Comment thread src/index.ts
export { Role } from './role';
export { ID } from './id';
export { Topic, ResolvedTopic } from './topic';
export { Topic } from './topic';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Document the removed wildcard Topic API

This release removes Topic.any()/.all() and the ResolvedTopic export that were available in 30.0.0-rc.2, so existing wildcard-topic code now fails to compile or throws at runtime. Since the v30 breaking-changes list does not mention this removal, please retain the API or document this incompatibility.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/index.ts
Line: 44

Comment:
**Document the removed wildcard Topic API**

This release removes `Topic.any()`/`.all()` and the `ResolvedTopic` export that were available in 30.0.0-rc.2, so existing wildcard-topic code now fails to compile or throws at runtime. Since the v30 breaking-changes list does not mention this removal, please retain the API or document this incompatibility.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · bug · Reply if this doesn't apply.

@ChiragAgg5k ChiragAgg5k changed the title feat: Node.js SDK update for version 30.0.0 feat: Node.js SDK update for version 30.0.1 Oct 15, 2026
@ChiragAgg5k

Copy link
Copy Markdown
Member Author

@hansi-codes review

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Tier B · See the inline comments. Summary

Comment thread src/client.ts
Comment on lines +99 to +102
for (const key of Object.keys(model.defaults ?? {})) {
if (!Object.prototype.hasOwnProperty.call(value, key)) {
result[key] = cloneDefault(result[key]);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Add coverage for default filling and per-model copies

The new defaults path changes responses with omitted fields and is intended to give each model independent nested defaults, but the existing and added tests do not exercise either case. A focused test would catch regressions that can leave fields absent or let a mutation on one returned model affect another.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/client.ts
Line: 99-102

Comment:
**Add coverage for default filling and per-model copies**

The new defaults path changes responses with omitted fields and is intended to give each model independent nested defaults, but the existing and added tests do not exercise either case. A focused test would catch regressions that can leave fields absent or let a mutation on one returned model affect another.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · testing · Reply if this doesn't apply.

@ChiragAgg5k
ChiragAgg5k merged commit 320249d into main Oct 15, 2026
1 check passed
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