Repository navigation
feat: SDK update for version 31.1.0 - #180
Conversation
🔵 Tier A · Mergeable after minor fixes
This release updates the Node.js SDK to 31.1.0 for Appwrite 2.6.2, adding migration APIs and new project policies and operations. It also updates runtime and model exports, hardens path and redirect handling, refreshes development dependencies, and revises documentation examples. 23 of 78 changed files were too large to include in full.
Note Part of the diff was too large to review, so Hansi did not approve.
Fix with agent prompt### Issue 1
src/client.ts:903-905
**Test the manual-redirect error path**
The existing client tests do not exercise a 3xx response, so they would not catch a regression that follows redirects again and forwards the configured API key to the `Location` target. A mocked redirect response should verify the call rejects with the location and does not issue a second fetch.
### Issue 2
docs/examples/project/create-environment.md:22
**Use the exported environment resource member**
The enum exports `Environmentvariable` (lowercase `v`), so `EnvironmentVariable` is undefined. JavaScript will serialize this array entry as `null` and TypeScript users will get a compile error; please use the exported member name.
```suggestion
sdk.EnvironmentResource.Environmentvariable,
```
### Issue 3
src/services/project.ts:544-545
**Test that environment resources are sent**
The existing `createEnvironment()` test does not pass `resources` or assert the request payload, so it would still pass if this new field stopped being sent. Please cover the resources payload in the service test.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.📂 Walkthrough · 9
⏳ Still open from earlier reviews · 2
Reviewed |
| sdk.EnvironmentResource.Bucket, | ||
| sdk.EnvironmentResource.Team, | ||
| sdk.EnvironmentResource.Function, | ||
| sdk.EnvironmentResource.EnvironmentVariable, |
There was a problem hiding this comment.
Use the exported environment resource member
The enum exports Environmentvariable (lowercase v), so EnvironmentVariable is undefined. JavaScript will serialize this array entry as null and TypeScript users will get a compile error; please use the exported member name.
| sdk.EnvironmentResource.EnvironmentVariable, | |
| sdk.EnvironmentResource.Environmentvariable, |
Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/examples/project/create-environment.md
Line: 22
Comment:
**Use the exported environment resource member**
The enum exports `Environmentvariable` (lowercase `v`), so `EnvironmentVariable` is undefined. JavaScript will serialize this array entry as `null` and TypeScript users will get a compile error; please use the exported member name.
```suggestion
sdk.EnvironmentResource.Environmentvariable,
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · documentation · Reply if this doesn't apply.
| if (typeof resources !== 'undefined') { | ||
| apiPayload['resources'] = resources; |
There was a problem hiding this comment.
Test that environment resources are sent
The existing createEnvironment() test does not pass resources or assert the request payload, so it would still pass if this new field stopped being sent. Please cover the resources payload in the service test.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/services/project.ts
Line: 544-545
Comment:
**Test that environment resources are sent**
The existing `createEnvironment()` test does not pass `resources` or assert the request payload, so it would still pass if this new field stopped being sent. Please cover the resources payload in the service test.
---
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.
|
@hansi-codes review |
| const response = await fetch(uri, { | ||
| ...options, | ||
| redirect: 'manual', |
There was a problem hiding this comment.
Test the manual-redirect error path
The existing client tests do not exercise a 3xx response, so they would not catch a regression that follows redirects again and forwards the configured API key to the Location target. A mocked redirect response should verify the call rejects with the location and does not issue a second fetch.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/client.ts
Line: 903-905
Comment:
**Test the manual-redirect error path**
The existing client tests do not exercise a 3xx response, so they would not catch a regression that follows redirects again and forwards the configured API key to the `Location` target. A mocked redirect response should verify the call rejects with the location and does not issue a second fetch.
---
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.
This PR contains updates to the SDK for version 31.1.0.
What's Changed
Migrationsservice to run Appwrite, Firebase, NHost, Supabase, CSV and JSON migrations, plus retries and listingAppwriteMigrationResource,FirebaseMigrationResource,NHostMigrationResource,SupabaseMigrationResourceandOnDuplicateenumsproject.updateDenyRealtimeGuestsPolicy,Models.PolicyDenyRealtimeGuestsandProjectPolicyId.Denyrealtimeguestsproject.deleteSessionsto sign out every user in the projectBillingPlan.deploymentRetention,deploymentRetentionMaxanddeploymentsRetentionCountpython-3.15,deno-2.9,go-1.27andrust-1.99toRuntimeandBuildRuntimeX-Appwrite-Response-Format: 2.6.2; README targets Appwrite 2.6.xAppwriteExceptionnaming theLocation.and..throwAppwriteExceptioninstead of changing the request URLeslint,typescript-eslint,prettierand@types/noderefreshed