feat: SDK update for version 15.9.0 - #110
Conversation
main received 15.7.0 as a squash merge (#108), so the same change exists under a different commit on each branch. main's tree is identical to dev's 15.7.0 commit, so dev's generated 15.8.0 tree is kept as-is.
Greptile SummaryUpdates the console SDK to 15.9.0.
Confidence Score: 4/5The positional WAF compatibility break and nullable branch-port type mismatch should be fixed before merging. Existing positional WAF calls are reinterpreted after the inserted key argument, and the branch model promises a number in a server state now documented to return null. Files Needing Attention: src/services/waf.ts, src/models.ts Important Files Changed
Prompt To Fix All With AI### Issue 1
src/services/waf.ts:823
**Positional arguments are reinterpreted**
When existing consumers call `createRateLimitRule` or `updateRateLimitRule` using the positional form, inserting `key` before `priority` shifts the existing arguments, causing TypeScript compilation failures or malformed JavaScript requests where priority, enabled, and conditions are assigned to the wrong payload fields.
### Issue 2
src/models.ts:9715-9718
**Nullable port remains non-nullable**
When a branch is returned before its backing reports a port, the documented runtime value is `null` but the model declares an always-present `number`, allowing consumers to perform unchecked numeric operations that produce incorrect results or throw.
```suggestion
/**
* Branch port. Null until the backing reports one.
*/
port?: number;
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "chore: update Console SDK to 15.9.0" | Re-trigger Greptile |
| * @param {boolean} enabled - Set to false to create the rule in a disabled state. | ||
| * @param {string} conditions - Array of condition strings generated using the WAF Condition builder. Maximum of 100 conditions are allowed, each 4096 characters long. | ||
| * @throws {AppwriteException} | ||
| * @returns {Promise<Models.WafRuleRateLimit>} |
There was a problem hiding this comment.
Positional arguments are reinterpreted
When existing consumers call createRateLimitRule or updateRateLimitRule using the positional form, inserting key before priority shifts the existing arguments, causing TypeScript compilation failures or malformed JavaScript requests where priority, enabled, and conditions are assigned to the wrong payload fields.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/services/waf.ts
Line: 823
Comment:
**Positional arguments are reinterpreted**
When existing consumers call `createRateLimitRule` or `updateRateLimitRule` using the positional form, inserting `key` before `priority` shifts the existing arguments, causing TypeScript compilation failures or malformed JavaScript requests where priority, enabled, and conditions are assigned to the wrong payload fields.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| /** | ||
| * Branch port. | ||
| * Branch port. Null until the backing reports one. | ||
| */ | ||
| port: number; |
There was a problem hiding this comment.
Nullable port remains non-nullable
When a branch is returned before its backing reports a port, the documented runtime value is null but the model declares an always-present number, allowing consumers to perform unchecked numeric operations that produce incorrect results or throw.
| /** | |
| * Branch port. | |
| * Branch port. Null until the backing reports one. | |
| */ | |
| port: number; | |
| /** | |
| * Branch port. Null until the backing reports one. | |
| */ | |
| port?: number; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/models.ts
Line: 9715-9718
Comment:
**Nullable port remains non-nullable**
When a branch is returned before its backing reports a port, the documented runtime value is `null` but the model declares an always-present `number`, allowing consumers to perform unchecked numeric operations that produce incorrect results or throw.
```suggestion
/**
* Branch port. Null until the backing reports one.
*/
port?: number;
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
This PR contains updates to the SDK for version 15.9.0.
What's Changed
client.setOrganization()to send theX-Appwrite-Organizationheader