feat: harden sessions and track downstream acknowledgements

This commit is contained in:
hectorzhao
2026-07-14 14:18:43 +08:00
parent 3d37adcc9f
commit 8c03663f24
43 changed files with 1733 additions and 150 deletions
@@ -4,6 +4,9 @@ import {
GatewayInboundAuthDto,
GatewayInboundSubmitDto,
GatewayPendingDeliveryQueryDto,
GatewayDownstreamAcknowledgedDto,
GatewayDownstreamFailureType,
GatewayDownstreamSentDto,
GatewayDownstreamRecoveryStatusDto,
GatewayReceiptEventDto,
GatewaySubmitDeadLetterDto,
@@ -66,9 +69,19 @@ export class GatewayEventsController {
return this.sendChain.markDownstreamDeliveryDelivered(body.id);
}
@Post('downstream/sent')
downstreamSent(@Body() body: GatewayDownstreamSentDto) {
return this.sendChain.markDownstreamDeliverySent(body);
}
@Post('downstream/acknowledged')
downstreamAcknowledged(@Body() body: GatewayDownstreamAcknowledgedDto) {
return this.sendChain.acknowledgeDownstreamDelivery(body);
}
@Post('downstream/failed')
downstreamFailed(@Body() body: { id: string; errorMessage?: string }) {
return this.sendChain.markDownstreamDeliveryFailed(body.id, body.errorMessage);
downstreamFailed(@Body() body: { id: string; errorMessage?: string; failureType?: GatewayDownstreamFailureType }) {
return this.sendChain.markDownstreamDeliveryFailed(body.id, body.errorMessage, body.failureType);
}
@Post('downstream/recovery-status')