feat: SDK update for version 15.3.0 - #104
Conversation
Greptile SummaryThis PR updates the Console SDK to version 15.3.0, adding new services (Mongo, Mysql, Postgresql, Notifications), OAuth2 PAR support, vector similarity query helpers, and extensive model updates to align with the 15.3.0 API surface.
Confidence Score: 3/5The The
Important Files Changed
|
| setBearer(value: string): this { | ||
| this.headers['Authorization'] = value; | ||
| this.config.bearer = value; | ||
| return this; | ||
| } |
There was a problem hiding this comment.
Missing
Bearer scheme prefix in Authorization header
setBearer stores the raw token value as Authorization: <value>, but RFC 6750 (OAuth 2.0 Bearer Token Usage) requires the format Authorization: Bearer <token>. Every other Appwrite SDK implementation (Swift, Dart, etc.) prepends "Bearer " inside the setter. Callers who pass a plain access token will generate a malformed header that the server will reject, causing authentication failures for all OAuth2 endpoints that rely on this method — including the new listOrganizations and listProjects calls which omit X-Appwrite-Project and depend solely on this header.
| setBearer(value: string): this { | |
| this.headers['Authorization'] = value; | |
| this.config.bearer = value; | |
| return this; | |
| } | |
| setBearer(value: string): this { | |
| this.headers['Authorization'] = 'Bearer ' + value; | |
| this.config.bearer = value; | |
| return this; | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/client.ts
Line: 559-563
Comment:
**Missing `Bearer ` scheme prefix in Authorization header**
`setBearer` stores the raw token value as `Authorization: <value>`, but RFC 6750 (OAuth 2.0 Bearer Token Usage) requires the format `Authorization: Bearer <token>`. Every other Appwrite SDK implementation (Swift, Dart, etc.) prepends `"Bearer "` inside the setter. Callers who pass a plain access token will generate a malformed header that the server will reject, causing authentication failures for all OAuth2 endpoints that rely on this method — including the new `listOrganizations` and `listProjects` calls which omit `X-Appwrite-Project` and depend solely on this header.
```suggestion
setBearer(value: string): this {
this.headers['Authorization'] = 'Bearer ' + value;
this.config.bearer = value;
return this;
}
```
How can I resolve this? If you propose a fix, please make it concise.| export type StageList = { | ||
| /** | ||
| * List of stages. | ||
| */ | ||
| stages: Stage[]; | ||
| } |
There was a problem hiding this comment.
StageList is the only list type in this SDK that omits a total: number field. Every other list model (NotificationList, ScheduleList, LogList, Oauth2ProjectList, etc.) includes it. If the API endpoint returns a total count, callers have no way to access it through this type, making pagination impossible to implement correctly.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/models.ts
Line: 688-693
Comment:
**`StageList` missing `total` field**
`StageList` is the only list type in this SDK that omits a `total: number` field. Every other list model (`NotificationList`, `ScheduleList`, `LogList`, `Oauth2ProjectList`, etc.) includes it. If the API endpoint returns a total count, callers have no way to access it through this type, making pagination impossible to implement correctly.
How can I resolve this? If you propose a fix, please make it concise.
This PR contains updates to the SDK for version 15.3.0, generated with sdk-generator 2.4.5.
Supersedes the
15.3.0-rc.1preview published frompreview-1.9.x-rcunder thenextnpm tag. Once released, the CLI SDK's@appwrite.io/consolepin should move from15.3.0-rc.1to15.3.0.What's Changed
Computeservice into engine-specificMysql,Postgresql, andMongoservicestablesDB.create()now takesspecificationinstead ofdedicatedDatabaseIdhealth.getQueueLogs()Notificationsservice for console notificationsorganization.get(),update(), anddelete()methodslistMemberships,createMembership,getMembership,updateMembership, anddeleteMembershiplistMigrations,createMigration,getMigration, anddeleteMigrationoauth2.createPAR(),listOrganizations(), andlistProjects()methodsrequestUriparameter onoauth2.authorize(); client ID, redirect URI, and response type are now optionallistAddons,getAddon,deleteAddon,confirmAddonPayment, andgetAddonPricecreatePremiumGeoDBAddon()onProjectsandOrganizationsaccount.listLogs(),teams.listLogs(), andusers.listLogs()methodshealth.getGeo()andhealth.getGeoPremium()methodsnewSpecificationparameter onbackups.createRestoration()promptandmaxAgeparameters onproject.updateOAuth2Oidc()BlockMode,DatabaseStatus,OAuth2OidcPrompt, andProjectOAuth2OidcPromptenums