Skip to content

feat: Node.js SDK update for version 30.0.0 - #173

Closed
ChiragAgg5k wants to merge 2 commits into
mainfrom
dev
Closed

ChiragAgg5k wants to merge 2 commits into
mainfrom
dev

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

This PR contains updates to the Node.js SDK for version 30.0.0.

@hansi-codes

hansi-codes Bot commented Oct 12, 2026

Copy link
Copy Markdown

馃數 Tier A 路 Mergeable after minor fixes

Three minor response-shape and serialization regressions need correction before relying on the new defaults.

Updates the Node.js SDK to version 30.0.0 and Appwrite response format 2.4.0. It adds passkey and WAF APIs, OAuth2 resource arrays, function intervals, new models and policies, and response default filling across services.

30 of 89 changed files were too large to include in full.

Verdict New comments Fixed Still open
馃挰 Commented 3 0 0

Note

Not approving while a bug finding is open: Preserve the custom response toString

Finding Where
馃煛 Preserve the custom response toString src/client.ts:82
馃煛 Default restoration options to an object src/services/backups.ts:982
馃煛 Default WAF config to an object src/services/waf.ts:293
Fix with agent prompt
### Issue 1
src/client.ts:82
**Preserve the custom response `toString`**

`Client.call` attaches a non-enumerable JSONbig `toString` to object responses, but this spread drops it. Responses passed through `applyDefaults` now stringify as `[object Object]` instead of JSON, changing the behavior of every service method using this helper.

### Issue 2
src/services/backups.ts:982
**Default restoration options to an object**

`Models.BackupRestoration.options` is now an object, but this fallback supplies an array (and the list/get response trees do the same). When a response omits `options`, callers receive the wrong shape and code expecting key-value options can fail.

### Issue 3
src/services/waf.ts:293
**Default WAF config to an object**

The WAF rule models declare `config` as an object, but the response defaults use an array (as do the other WAF rule response trees). When a response omits `config`, the SDK returns the wrong shape and callers expecting configuration properties can fail.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
馃搨 Walkthrough 路 5
File Change
CHANGELOG.md, README.md, package.json, docs/examples/** Documents the 30.0.0 release, targets API 2.4.0, and adds examples for new and updated APIs.
src/client.ts Updates SDK request headers and adds recursive response default filling.
src/models.ts, src/enums/**, src/index.ts Adds and exports API 2.4.0 models, enums, and the WAF service.
src/services/** Updates generated service methods and applies model defaults to responses, including passkey and WAF APIs.
test/services/** Updates database response fixtures and adds or updates service coverage.

Reviewed a8b7626 路 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

Comment thread src/client.ts
if (Array.isArray(value)) {
return value;
}
const result: Record<string, unknown> = { ...model.defaults, ...value };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Preserve the custom response toString

Client.call attaches a non-enumerable JSONbig toString to object responses, but this spread drops it. Responses passed through applyDefaults now stringify as [object Object] instead of JSON, changing the behavior of every service method using this helper.

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

Comment:
**Preserve the custom response `toString`**

`Client.call` attaches a non-enumerable JSONbig `toString` to object responses, but this spread drops it. Responses passed through `applyDefaults` now stringify as `[object Object]` instead of JSON, changing the behavior of every service method using this helper.

---

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.

Comment thread src/services/backups.ts
policyId: '',
status: '',
migrationId: '',
options: [],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Default restoration options to an object

Models.BackupRestoration.options is now an object, but this fallback supplies an array (and the list/get response trees do the same). When a response omits options, callers receive the wrong shape and code expecting key-value options can fail.

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

Comment:
**Default restoration options to an object**

`Models.BackupRestoration.options` is now an object, but this fallback supplies an array (and the list/get response trees do the same). When a response omits `options`, callers receive the wrong shape and code expecting key-value options can fail.

---

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.

Comment thread src/services/waf.ts
priority: 0,
enabled: true,
conditions: [],
config: [],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Default WAF config to an object

The WAF rule models declare config as an object, but the response defaults use an array (as do the other WAF rule response trees). When a response omits config, the SDK returns the wrong shape and callers expecting configuration properties can fail.

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

Comment:
**Default WAF config to an object**

The WAF rule models declare `config` as an object, but the response defaults use an array (as do the other WAF rule response trees). When a response omits `config`, the SDK returns the wrong shape and callers expecting configuration properties can fail.

---

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

Copy link
Copy Markdown
Member Author

Superseded: replaced by a passkeys-only minor release.

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.

1 participant