Skip to content

feat: Node.js SDK update for version 25.0.0#152

Merged
abnegate merged 5 commits into
mainfrom
dev
May 19, 2026
Merged

feat: Node.js SDK update for version 25.0.0#152
abnegate merged 5 commits into
mainfrom
dev

Conversation

@ArnabChatterjee20k
Copy link
Copy Markdown
Member

@ArnabChatterjee20k ArnabChatterjee20k commented May 18, 2026

This PR contains updates to the Node.js SDK for version 25.0.0.

What's Changed

  • Breaking: Renamed AuthMethod enum to ProjectAuthMethodId
  • Breaking: Renamed EmailTemplateType to ProjectEmailTemplateId and EmailTemplateLocale to ProjectEmailTemplateLocale
  • Breaking: Renamed ServiceId to ProjectServiceId, ProtocolId to ProjectProtocolId, Secure to ProjectSMTPSecure, ProjectPolicy to ProjectPolicyId
  • Breaking: Replaced Scopes enum with ProjectKeyScopes for project key endpoints
  • Breaking: Removed updateDenyCanonicalEmailPolicy; replaced with updateDenyAliasedEmailPolicy, updateDenyDisposableEmailPolicy, and updateDenyFreeEmailPolicy
  • Breaking: Removed AuthProvider model; use new ProjectOAuthProviderId enum instead
  • Added: Project.get method to fetch current project details
  • Added: Advisor, Presences, and Usage services
  • Added: Insight, Presence, Report, UsageEvent, and UsageGauge models with list variants
  • Added: ProjectAuthMethod, ProjectProtocol, and ProjectService models
  • Added: ProjectOAuthProviderId and ProjectOAuth2GooglePrompt enums
  • Updated: Project, Database, and OAuth2Google model schemas
  • Updated: X-Appwrite-Response-Format header to 1.9.5

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 18, 2026

Greptile Summary

This PR updates the Node.js SDK to version 25.0.0, introducing three new services (Advisor, Presences, Usage), new models, and a sweeping rename of project-scoped enums (e.g. AuthMethodProjectAuthMethodId, ScopesProjectKeyScopes).

  • New services: Advisor (report/insight CRUD), Presences (presence log management), and Usage (event/gauge queries) are added with both object-param and positional-param overloads following SDK conventions.
  • Enum renames: Seven project-scoped enums are renamed with Project prefixes; old names are removed from exports and the new ProjectKeyScopes replaces Scopes for key endpoints.
  • Type inconsistency: OAuth2GooglePrompt (used in Models.OAuth2Google.prompt) and ProjectOAuth2GooglePrompt (used in Project.updateOAuth2Google parameters) are two separate enums with identical values — both exported from index.ts. Because TypeScript enums are nominal, passing prompt values read from a response back into the service method produces a compile-time type error.
  • Undocumented breaking change: OAuthProvider.GithubImagine and OAuthProvider.GoogleImagine are silently removed from the still-exported OAuthProvider enum; this is not listed in the changelog or PR description.

Confidence Score: 3/5

The new services are well-formed, but two issues in the exported enum surface make this risky to ship without fixes.

The OAuth2GooglePrompt/ProjectOAuth2GooglePrompt split creates a compile-time breakage for TypeScript users working with the Google OAuth2 prompt round-trip. The silent removal from OAuthProvider affects users of those two providers without any migration guidance. Both touch the public API surface of this major release.

src/index.ts (duplicate enum exports), src/enums/o-auth-provider.ts (silent member removal), and src/models.ts / src/services/project.ts where the divergent prompt enum types meet.

Important Files Changed

Filename Overview
src/index.ts Adds new service and enum exports; exports two identical enums (OAuth2GooglePrompt and ProjectOAuth2GooglePrompt) that create a type mismatch between model fields and service parameters
src/enums/o-auth-provider.ts Silently removes GithubImagine and GoogleImagine from the still-exported OAuthProvider enum without documenting the breaking change
src/services/project.ts Major rework: renames project-specific enums, adds get/delete methods, three new policy endpoints, and replaces updateDenyCanonicalEmailPolicy; uses ProjectOAuth2GooglePrompt for updateOAuth2Google which conflicts with OAuth2GooglePrompt in the model return type
src/services/advisor.ts New service with listReports, getReport, deleteReport, listInsights, getInsight; implementation follows established SDK patterns correctly
src/services/presences.ts New service with full CRUD for presence logs; uses generic type parameter correctly and follows SDK conventions
src/services/usage.ts New service exposing listEvents and listGauges for usage metrics; straightforward and correct
src/models.ts Adds Presence, PresenceList, InsightList, ReportList, and other new models; updates Project schema; imports OAuth2GooglePrompt for OAuth2Google.prompt field which diverges from the ProjectOAuth2GooglePrompt used by the service
src/enums/project-key-scopes.ts New enum replacing Scopes for project key endpoints; comprehensive scope list matching the API
src/enums/project-o-auth-provider-id.ts New enum replacing AuthProvider model for OAuth2 provider identification, includes GithubImagine and GoogleImagine that were removed from OAuthProvider
.github/workflows/publish.yml Actions pinned to commit SHAs for supply-chain security; logic for RC vs stable publish tag is unchanged

Reviews (1): Last reviewed commit: "chore: update Node.js SDK to 25.0.0" | Re-trigger Greptile

Comment thread src/index.ts
@@ -72,6 +78,7 @@ export { IndexStatus } from './enums/index-status';
export { DeploymentStatus } from './enums/deployment-status';
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 Duplicate enum export causing type mismatch

OAuth2GooglePrompt (exported here, used in Models.OAuth2Google.prompt) and ProjectOAuth2GooglePrompt (line 52, used in Project.updateOAuth2Google) are two separate enums with identical string values. Because TypeScript enums are nominally typed, a value of one enum cannot be assigned to the other. A user reading result.prompt from the updateOAuth2Google response (typed OAuth2GooglePrompt[]) and passing it back in a subsequent call (which expects ProjectOAuth2GooglePrompt[]) will get a compile-time type error even though the runtime values are identical. One of these enums should be consolidated — models.ts should import ProjectOAuth2GooglePrompt for the OAuth2Google.prompt field, or the service should accept OAuth2GooglePrompt[], eliminating the duplicate.

Comment on lines 42 to 45
Yandex = 'yandex',
Zoho = 'zoho',
Zoom = 'zoom',
GithubImagine = 'githubImagine',
GoogleImagine = 'googleImagine',
} No newline at end of file
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 Undocumented removal of GithubImagine and GoogleImagine from OAuthProvider

The PR description only documents removing the AuthProvider model, but the still-exported OAuthProvider enum silently loses GithubImagine and GoogleImagine members. Any existing code using OAuthProvider.GithubImagine or OAuthProvider.GoogleImagine will break at compile time without a migration path in the changelog. These two members are present in the new ProjectOAuthProviderId enum, but OAuthProvider is not deprecated here — it remains a first-class export — so users have no indication they should switch. This should be explicitly called out as a breaking change, or the members should be kept in OAuthProvider with a deprecation notice.

@abnegate abnegate merged commit 2438df0 into main May 19, 2026
3 checks 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