chore: migrate livechat/tags and livechat/tags/:tagId to OpenAPI chained API pattern#39802
chore: migrate livechat/tags and livechat/tags/:tagId to OpenAPI chained API pattern#39802NAME-ASHWANIYADAV wants to merge 2 commits intoRocketChat:developfrom
Conversation
🦋 Changeset detectedLatest commit: e790d4d The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
WalkthroughRefactors Livechat tags server routes to a chained API registration with explicit query and response schemas; updates REST typings to make the Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can generate walkthrough in a markdown collapsible section to save space.Enable the |
Tracking Issue
Part of RocketChat/Rocket.Chat-Open-API#150
Endpoints migrated:
livechat/tags(GET)livechat/tags/:tagId(GET)Changes
packages/rest-typings/src/v1/omnichannel.ts
textto optional in LivechatTagsListProps type &LivechatTagsListSchema— the existing schema markedtextasrequired, but the actual endpoint and 8+ integration tests treat it as optional. Without this fix, enabling AJV query validation would break all tests that don't passtext.GETLivechatTagsSuccessResponse— paginated response with{tags, count, offset, total, success}andadditionalProperties: falseGETLivechatTagByIdSuccessResponse— single tag response with{_id, name, description, numDepartments, departments, success}andadditionalProperties: false/v1/livechat/tagsand/v1/livechat/tags/:tagIdfrom OmnichannelEndpoints (types are now inferred viaExtractRoutesFromAPI)apps/meteor/ee/app/livechat-enterprise/server/api/tags.ts
API.v1.addRoute()endpoints to chained.get()callslivechatTagsEndpointschain alongside already-migratedtags.saveandtags.deletequery: isLivechatTagsListPropsfor input validation on the list endpointresponsevalidators (200, 401, 403, 404) on both endpointsEndpoint chain structure (after migration):
SDK Check
livechat/tagsis NOT consumed by@rocket.chat/ddp-client— safe to delete manual typingsVerification
✅ Build
yarn build— 67/67 packages compiled successfully, 0 errors.✅ Swagger UI
GET /livechat/tags— 200 OK:✅ Integration Tests
yarn testapi:livechat— 181 passing, 81 pending (EE), 1 pre-existing failure (unrelated02-appearance.tstest).0 failures from this PR's changes.
Checklist
.get()usedisLivechatTagsListProps)additionalProperties: falseExtractRoutesFromAPIrest-typingsMissingRefErroryarn testapi:livechatpassesSummary by CodeRabbit
Refactor
Improvements
Chores