refactor: migrate groups.delete to new architecture

Closed
CE
10d ago
+84-29

Description

Migrates the legacy groups.delete endpoint to the new REST API architecture using inline AJV validation.

Key Changes:

  • Replaced manual parameter validation with inline AJV schema.
  • Implemented oneOf logic to strictly handle roomId OR roomName mutually exclusively (matching legacy behavior exactly).
  • Removed the redundant GroupsDeleteProps interface and updated index exports to reduce double-bookkeeping.
  • Appended ExtractRoutesFromAPI to register the endpoint globally in @rocket.chat/rest-typings.
  • Generated changeset.

Testing Performed

  • Verified locally using TEST_MODE=true.
  • yarn testapi -g 'groups.delete' passes completely (5/5 tests). image
  • Targeted eslint --fix passes with 0 errors on modified files.
  • Verified correct schema in swagger. image
image

Summary by CodeRabbit

  • New Features

    • Added a new API endpoint to delete private groups by ID or name.
  • Bug Fixes

    • Improved input validation and error responses for the group deletion flow.
  • Refactor

    • Migrated groups management to the new REST API architecture for greater consistency.