-
Notifications
You must be signed in to change notification settings - Fork 13.9k
feat(rest-typings): migrate four user endpoints to Ajv validation #39222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Harshit2405-2004
wants to merge
25
commits into
RocketChat:develop
from
Harshit2405-2004:feat-rest-typings-video-conference
Closed
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
f227c81
feat(rest-typings): migrate four user endpoints to Ajv
Harshit2405-2004 a64fa34
chore: add changeset for users REST param validations migrations
Harshit2405-2004 da0ff36
refactor(rest-typings): remove duplicate ajv validator exports
Harshit2405-2004 57f2327
fix(rest-typings): address validation schema gaps in users REST API
Harshit2405-2004 075af9c
feat(api): Enforce Schema Validation on groups.list and groups.listAll
Harshit2405-2004 7a75a9d
ci: fix dedupe workflow claude action inputs and ignore auth errors
Harshit2405-2004 e77c2b1
fix(groups): allow
Harshit2405-2004 163b463
refactor(rest-typings): enforce strict mutual exclusivity for user av…
Harshit2405-2004 f90fe50
refactor(rest-typings): align users.getAvatar signature with strict u…
Harshit2405-2004 d9fc7e1
fix(rest-typings): remove unused IUser import in UsersGetAvatarParamsGET
Harshit2405-2004 6253b4f
fix: address review feedback from CodeRabbit and ggazzo
Harshit2405-2004 0929d43
refactor(rest-typings): enforce strict mutual exclusivity for user av…
Harshit2405-2004 36b9b33
refactor(rest-typings): align users.getAvatar signature with strict u…
Harshit2405-2004 f65a9b3
fix(rest-typings): remove unused IUser import in UsersGetAvatarParamsGET
Harshit2405-2004 272dcd1
chore: cleanup changeset and remove unrelated groups mention
Harshit2405-2004 82cf45a
fix: resolve CI failures and fix indentation in groups REST API
Harshit2405-2004 d853e09
chore: ignore .agent and .optimization folders local to development
Harshit2405-2004 ac9cfed
fix(api): resolve lint failures in REST typings and ignore local meta…
Harshit2405-2004 49e031f
Merge branch 'feat-groups-list-validation' into feat-rest-typings-vid…
Harshit2405-2004 5ed98d1
fix(rest-typings): fix Prettier formatting in users.ts
Harshit2405-2004 a0ca08c
Merge branch 'develop' into feat-rest-typings-video-conference
Harshit2405-2004 897c750
Merge branch 'develop' into feat-rest-typings-video-conference
Harshit2405-2004 79b7a86
Merge branch 'develop' into feat-rest-typings-video-conference
Harshit2405-2004 a4a44ae
Merge branch 'develop' into feat-rest-typings-video-conference
Harshit2405-2004 9ba13b2
Merge branch 'develop' into feat-rest-typings-video-conference
Harshit2405-2004 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| '@rocket.chat/rest-typings': patch | ||
| '@rocket.chat/meteor': patch | ||
| --- | ||
|
|
||
| Migrated `users.getAvatar`, `users.deleteOwnAccount`, `users.resetAvatar`, and `users.forgotPassword` to explicit `Ajv` schema validation. Similarly, `groups.list` and `groups.listAll` were migrated to ensure strict parameter validation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,3 +62,7 @@ storybook-static | |
| development/tempo-data/ | ||
|
|
||
| .env | ||
|
|
||
| # Antigravity local folders | ||
| .agent/ | ||
| .optimization/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,38 @@ | ||
| import type { PaginatedRequest } from '../../helpers/PaginatedRequest'; | ||
| import { ajv } from '../Ajv'; | ||
|
|
||
| export type GroupsListProps = PaginatedRequest<null>; | ||
| const groupsListPropsSchema = {}; | ||
| export type GroupsListProps = PaginatedRequest<{ name?: string }>; | ||
|
|
||
| const groupsListPropsSchema = { | ||
| type: 'object', | ||
| properties: { | ||
| count: { | ||
| type: 'number', | ||
| nullable: true, | ||
| }, | ||
| offset: { | ||
| type: 'number', | ||
| nullable: true, | ||
| }, | ||
| sort: { | ||
| type: 'string', | ||
| nullable: true, | ||
| }, | ||
| fields: { | ||
| type: 'string', | ||
| nullable: true, | ||
| }, | ||
| query: { | ||
| type: 'string', | ||
| nullable: true, | ||
| }, | ||
| name: { | ||
| type: 'string', | ||
| nullable: true, | ||
| }, | ||
| }, | ||
| required: [], | ||
| additionalProperties: false, | ||
| }; | ||
|
|
||
| export const isGroupsListProps = ajv.compile<GroupsListProps>(groupsListPropsSchema); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/rest-typings/src/v1/users/UsersDeleteOwnAccountParamsPOST.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| export type UsersDeleteOwnAccountParamsPOST = { | ||
| password: string; | ||
| confirmRelinquish?: boolean; | ||
| }; |
3 changes: 3 additions & 0 deletions
3
packages/rest-typings/src/v1/users/UsersForgotPasswordParamsPOST.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export type UsersForgotPasswordParamsPOST = { | ||
| email: string; | ||
| }; |
4 changes: 4 additions & 0 deletions
4
packages/rest-typings/src/v1/users/UsersGetAvatarParamsGET.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| export type UsersGetAvatarParamsGET = | ||
| | { userId: string; username?: never; user?: never } | ||
| | { username: string; userId?: never; user?: never } | ||
| | { user: string; userId?: never; username?: never }; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.