Skip to content

feat: SDK update for version 31.1.0 - #180

Merged
ChiragAgg5k merged 8 commits into
mainfrom
dev
Oct 28, 2026
Merged

ChiragAgg5k merged 8 commits into
mainfrom
dev

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

This PR contains updates to the SDK for version 31.1.0.

What's Changed

  • Added: Migrations service to run Appwrite, Firebase, NHost, Supabase, CSV and JSON migrations, plus retries and listing
  • Added: AppwriteMigrationResource, FirebaseMigrationResource, NHostMigrationResource, SupabaseMigrationResource and OnDuplicate enums
  • Added: project.updateDenyRealtimeGuestsPolicy, Models.PolicyDenyRealtimeGuests and ProjectPolicyId.Denyrealtimeguests
  • Added: project.deleteSessions to sign out every user in the project
  • Added: BillingPlan.deploymentRetention, deploymentRetentionMax and deploymentsRetentionCount
  • Added: python-3.15, deno-2.9, go-1.27 and rust-1.99 to Runtime and BuildRuntime
  • Updated: requests send X-Appwrite-Response-Format: 2.6.2; README targets Appwrite 2.6.x
  • Updated: redirects are no longer followed; a 3xx throws AppwriteException naming the Location
  • Fixed: path parameters . and .. throw AppwriteException instead of changing the request URL
  • Updated: dev dependencies eslint, typescript-eslint, prettier and @types/node refreshed

@hansi-codes

hansi-codes Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

🔵 Tier A · Mergeable after minor fixes

The redirect behavior change needs a regression test to protect the API-key redirect safeguard.

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.

Verdict New comments Fixed Still open
💬 Commented 1 0 2

Note

Part of the diff was too large to review, so Hansi did not approve.

Finding Where
🟡 Test the manual-redirect error path src/client.ts:903
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
File Change
.github/workflows/publish.yml Pass the Git reference through an environment variable when selecting the release tag.
CHANGELOG.md, README.md Document the 31.1.0 release and Appwrite 2.6.x target.
docs/examples/** Add migration and project API examples and revise existing examples.
package.json, package-lock.json Bump the SDK version and refresh development dependencies.
src/client.ts Add safe path-segment encoding, update request headers, and stop following API redirects.
src/enums/** Add migration, environment, and duplicate-handling enums and new runtime and policy values.
src/index.ts, src/models.ts Export the new services and enums and add migration and policy models.
src/services/** Add migration and project operations and use guarded path encoding across service routes.
test/services/** Add or update service tests for the new SDK APIs.
⏳ Still open from earlier reviews · 2

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

@ChiragAgg5k ChiragAgg5k changed the title feat: Node.js SDK update for version 31.1.0 feat: SDK update for version 31.1.0 Oct 27, 2026

@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 · 1 blocking finding to address. Summary

Comment thread src/services/migrations.ts Resolved
@ChiragAgg5k ChiragAgg5k changed the title feat: SDK update for version 31.1.0 feat: Node.js SDK update for version 31.1.0 Oct 27, 2026

@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 · Looks good to merge. Summary

sdk.EnvironmentResource.Bucket,
sdk.EnvironmentResource.Team,
sdk.EnvironmentResource.Function,
sdk.EnvironmentResource.EnvironmentVariable,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Suggested change
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.

Comment thread src/services/project.ts
Comment on lines +544 to +545
if (typeof resources !== 'undefined') {
apiPayload['resources'] = resources;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@ChiragAgg5k ChiragAgg5k changed the title feat: Node.js SDK update for version 31.1.0 feat: SDK update for version 31.1.0 Oct 27, 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 A · See the inline comments. Summary

Comment thread src/client.ts
Comment on lines +903 to +905
const response = await fetch(uri, {
...options,
redirect: 'manual',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@ChiragAgg5k
ChiragAgg5k merged commit 50c4e5d into main Oct 28, 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