Repository navigation
feat: Node.js SDK update for version 30.0.0 - #173
ChiragAgg5k wants to merge 2 commits into
Conversation
馃數 Tier A 路 Mergeable after minor fixes
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.
Note Not approving while a bug finding is open: Preserve the custom response
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
Reviewed |
| if (Array.isArray(value)) { | ||
| return value; | ||
| } | ||
| const result: Record<string, unknown> = { ...model.defaults, ...value }; |
There was a problem hiding this 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.
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.
| policyId: '', | ||
| status: '', | ||
| migrationId: '', | ||
| options: [], |
There was a problem hiding this 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.
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.
| priority: 0, | ||
| enabled: true, | ||
| conditions: [], | ||
| config: [], |
There was a problem hiding this 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.
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.
|
Superseded: replaced by a passkeys-only minor release. |
This PR contains updates to the Node.js SDK for version 30.0.0.