-
Notifications
You must be signed in to change notification settings - Fork 13k
feat: Add OpenAPI Support to Statistics API #35692
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
Draft
ahmed-n-abdeltwab
wants to merge
38
commits into
RocketChat:develop
Choose a base branch
from
ahmed-n-abdeltwab:feat/OpenAPI
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
ed2feda
Create odd-hounds-develop.md
ahmed-n-abdeltwab 763c493
feat: adds statistics API with detailed schemas
ahmed-n-abdeltwab 2efd333
refactor: copy from the rest-typings in packages and typing to the bo…
ahmed-n-abdeltwab 969497e
feat: add statistics endpoints and extend API typings
ahmed-n-abdeltwab 7985303
feat: add statistics list endpoints and extend API typings
ahmed-n-abdeltwab 5ce85e0
feat: add telemetry endpoints to statistics type and extend API typings
ahmed-n-abdeltwab 3ea3eb1
refactor: remove unused Statistics import from index.ts
ahmed-n-abdeltwab fa97d5e
refactor: remove statistics type definitions and related schemas
ahmed-n-abdeltwab 231f963
fix: update Statistics and StatisticsList type definitions
ahmed-n-abdeltwab f67c0e4
fix: add statistics endpoint schemas to allow null values for optiona…
ahmed-n-abdeltwab 3831bba
Merge branch 'develop' into feat/OpenAPI
ahmed-n-abdeltwab 911cc0b
fix: update statistics endpoint schemas to use 'oneOf' instead of 'an…
ahmed-n-abdeltwab 80b47f5
fix: use the IControl instead to fix the missing 'hash' pros
ahmed-n-abdeltwab c9e337e
fix: add missing statistics schema
ahmed-n-abdeltwab b8bf637
fix: update statistics endpoint schemas to use 'anyOf' instead of 'on…
ahmed-n-abdeltwab db0a4f2
fix: replace integer with number
ahmed-n-abdeltwab 0b19d0e
Merge branch 'develop' into feat/OpenAPI
ahmed-n-abdeltwab e339c53
chore: add debug logs
ahmed-n-abdeltwab 7bbe36b
fix: the stats schema by make it more details
ahmed-n-abdeltwab e0219a3
fix: add miss pros 'id' to omnichannelSources
ahmed-n-abdeltwab 07c8556
fix: add missing [] to omnichannelSources
ahmed-n-abdeltwab cf5b142
fix: add debug logs
ahmed-n-abdeltwab 7c5367e
fix: add debug logs
ahmed-n-abdeltwab 091d0d3
Merge branch 'develop' into feat/OpenAPI
ahmed-n-abdeltwab c8102e4
fix: add more debug logs
ahmed-n-abdeltwab 710364e
fix: add missing pros and clean the schemas
ahmed-n-abdeltwab 2dbcac6
chore: add TODO for a duplicated pros
ahmed-n-abdeltwab 3a8f6b5
chore: add logs for debug
ahmed-n-abdeltwab 75bb683
chore: remove the debug logs and add clear the message TODO
ahmed-n-abdeltwab 3830ef5
Merge branch 'develop' into feat/OpenAPI
ahmed-n-abdeltwab f52adeb
Merge branch 'develop' into feat/OpenAPI
ahmed-n-abdeltwab 5628234
refactor: update the code to the last pattern
ahmed-n-abdeltwab 34ccb6c
chore: clean up TODO after completion
ahmed-n-abdeltwab 7db9ba2
feat: use typia for the IStats
ahmed-n-abdeltwab 18c6218
fix: return 0 from getAppsStatistics instead of false to satisfy Typi…
ahmed-n-abdeltwab 19affff
fix: remove the string from lastMessageSentAt to Date only to satisf…
ahmed-n-abdeltwab 3aa34ce
Merge branch 'develop' into feat/OpenAPI
ahmed-n-abdeltwab 2748afa
Merge branch 'develop' into feat/OpenAPI
ahmed-n-abdeltwab 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
Some comments aren't visible on the classic Files Changed page.
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,5 @@ | ||
| --- | ||
| "@fake-scope/fake-pkg": patch | ||
| --- | ||
|
|
||
| Add OpenAPI support for the Rocket.Chat Statistics API endpoints by migrating to a modern chained route definition syntax and utilizing shared AJV schemas for validation to enhance API documentation and ensure type safety through response 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
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 |
|---|---|---|
|
|
@@ -221,9 +221,10 @@ export const statistics = { | |
| }), | ||
| ); | ||
|
|
||
| // TODO: the routingAlgorithm is duplicated in L202 & L227 | ||
| // Type of routing algorithm used on omnichannel | ||
| statistics.routingAlgorithm = settings.get('Livechat_Routing_Method'); | ||
|
|
||
| // TODO: the onHoldEnabled is duplicated in L205 & L230 | ||
| // is on-hold active | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the onHoldEnabled, routingAlgorithm are duplicated in the stats lib |
||
| statistics.onHoldEnabled = settings.get('Livechat_allow_manual_on_hold'); | ||
|
|
||
|
|
||
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 |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ type updateCounterDataType = { settingsId: string }; | |
| type slashCommandsDataType = { command: string }; | ||
| type otrDataType = { rid: string }; | ||
|
|
||
| // TODO this is duplicated from /packages/rest-typings/src/v1/statistics.ts | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. solved |
||
| export type TelemetryMap = { otrStats: otrDataType; slashCommandsStats: slashCommandsDataType; updateCounter: updateCounterDataType }; | ||
| export type TelemetryEvents = keyof TelemetryMap; | ||
|
|
||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Numbers can behave like booleans—0 is treated as false and values greater than 0 as true. This causes confusion with the oneOf schemas generated by Typia