Spaces:
Runtime error
Runtime error
| import { Controller, Param, Post } from '@nestjs/common'; | |
| import { ApiTags, ApiResponse } from '@nestjs/swagger'; | |
| import { RequireRole } from '../auth/decorators/auth.decorators'; | |
| import { ApiKeyRole } from '../auth/entities/api-key.entity'; | |
| import { RedriveService } from './redrive.service'; | |
| // Re-dispatching DLQ'd inbound payloads can cause real downstream sends, so this operator action is | |
| // ADMIN-gated — matching the sibling IntegrationInstanceController. (A bare API key, even VIEWER, | |
| // must NOT be able to trigger it.) | |
| ('integration') | |
| ('integration/instances') | |
| (ApiKeyRole.ADMIN) | |
| export class RedriveController { | |
| constructor(private readonly redrive: RedriveService) {} | |
| (':pluginId/:instanceId/redrive') | |
| ({ | |
| status: 201, | |
| description: 'One bounded batch of dead-lettered ingress deliveries re-dispatched, with remaining depth.', | |
| }) | |
| redriveInstance( | |
| ('pluginId') pluginId: string, | |
| ('instanceId') instanceId: string, | |
| ): Promise<{ redriven: number; remaining: number; batchSize: number }> { | |
| return this.redrive.redriveInstance(pluginId, instanceId); | |
| } | |
| } | |