Skip to content

feat: SDK update for version 0.4.0#13

Open
ChiragAgg5k wants to merge 2 commits intomainfrom
dev
Open

feat: SDK update for version 0.4.0#13
ChiragAgg5k wants to merge 2 commits intomainfrom
dev

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

@ChiragAgg5k ChiragAgg5k commented May 1, 2026

This PR contains updates to the SDK for version 0.4.0.

What's Changed

  • Breaking: Renamed Project::update_protocol_status to Project::update_protocol
  • Breaking: Renamed Project::update_service_status to Project::update_service
  • Breaking: Renamed Project model field smtp_reply_to to smtp_reply_to_email
  • Added password, session and membership policy methods: update_membership_privacy_policy, update_password_dictionary_policy, update_password_history_policy, update_password_personal_data_policy, update_session_alert_policy, update_session_duration_policy, update_session_invalidation_policy, update_session_limit_policy, update_user_limit_policy
  • Added Project::update_smtp and Project::create_smtp_test
  • Added email template methods: update_email_template, get_email_template
  • Added EmailTemplate model and EmailTemplateLocale, EmailTemplateType, Secure enums
  • Added auth_memberships_user_id, auth_memberships_user_phone, smtp_reply_to_name fields to Project model
  • Added user_phone field to Membership model
  • Added templates.read and templates.write to Scopes enum
  • Added deno-1.21, deno-1.24, deno-1.35 to Runtime and BuildRuntime enums
  • Updated X-Appwrite-Response-Format header to 1.9.2
  • Updated Cargo.toml to constrain url to >=2.5.4, <2.6 and add idna and idna_adapter
  • Fixed examples to wrap optional parameters in Some(...)

@ChiragAgg5k ChiragAgg5k changed the title feat: Rust SDK update for version 0.4.0 feat: SDK update for version 0.4.0 May 1, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 1, 2026

Greptile Summary

This PR bumps the SDK to version 0.4.0 (targeting Appwrite API 1.9.2), adding a suite of new project service methods for policy management, SMTP configuration, and email-template CRUD, alongside new enums (Secure, EmailTemplateType, EmailTemplateLocale) and models (EmailTemplate). Several issues flagged in previous review threads remain open in the code — most notably the update_email_template endpoint routing the templateId as a body param rather than a path segment, and bare integer literals passed where Option<i64> is expected in example docs.

Confidence Score: 3/5

Not safe to merge until the update_email_template path routing bug and example compilation errors are resolved.

Multiple P1 issues flagged in previous review threads remain unaddressed: templateId sent as body param while the endpoint likely expects it in the URL path (causing 404/400 at runtime), and several example docs that won't compile due to bare integer literals where Option<i64> is required.

src/services/project.rs (endpoint routing for update_email_template) and the example docs for update-password-history-policy.md, update-session-limit-policy.md, and update-user-limit-policy.md.

Important Files Changed

Filename Overview
src/services/project.rs Adds 10+ new service methods (policy management, SMTP, email templates); update_email_template sends templateId as body param while the GET sibling uses a path segment, and a doc-comment typo ("passwird") exist — both flagged in previous threads.
Cargo.toml Version bumped to 0.4.0; idna and idna_adapter promoted to direct deps with range constraints.
src/models/email_template.rs New EmailTemplate model with all fields as non-optional strings; includes basic serialization tests.
src/models/membership.rs Adds non-optional user_phone: String field, consistent with user_email convention.
src/models/project.rs Adds new auth-membership privacy fields and splits smtp_reply_to into smtp_reply_to_name/smtp_reply_to_email; changes look correct.
src/enums/email_template_locale.rs New EmailTemplateLocale enum with 100+ locale variants; serialization and display implementations look correct.
src/enums/secure.rs New Secure enum for TLS/SSL SMTP configuration; implementation is straightforward and correct.
src/client.rs Version header bumps only; the call method correctly routes GET params as query strings and non-GET params as JSON body.

Reviews (2): Last reviewed commit: "chore: update Rust SDK to 0.4.0" | Re-trigger Greptile

Comment thread docs/examples/project/update-password-history-policy.md
Comment thread src/services/project.rs
Comment on lines +729 to +732
let path = "/project/templates/email/{templateId}".to_string().replace("{templateId}", &template_id.to_string());

self.client.call(Method::GET, &path, None, Some(params)).await
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 templateId sent as body param but path uses no ID segment

update_email_template inserts templateId into params (the request body) and targets the path /project/templates/email, while the sibling get_email_template uses templateId as a URL path segment (/project/templates/email/{templateId}). If the Appwrite 1.9.2 PATCH endpoint also expects the template type in the path (matching the GET), the current implementation will hit the wrong route and the server will return a 404 or 400. The templateId should likely be substituted into the path instead of sent in the body.

// Likely intended:
let path = "/project/templates/email/{templateId}"
    .to_string()
    .replace("{templateId}", &template_id.to_string());
// and remove: params.insert("templateId".to_string(), json!(template_id));

Comment thread src/services/project.rs
Comment thread Cargo.toml Outdated
@ChiragAgg5k ChiragAgg5k changed the title feat: SDK update for version 0.4.0 feat: Rust SDK update for version 0.4.0 May 1, 2026
@ChiragAgg5k ChiragAgg5k changed the title feat: Rust SDK update for version 0.4.0 feat: SDK update for version 0.4.0 May 1, 2026
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