feat: [CHA-2563] add retention policy endpoints#1713
Merged
Conversation
Add server-side methods for managing retention policies: - setRetentionPolicy: create/update a retention policy - deleteRetentionPolicy: remove a retention policy - getRetentionPolicy: list all policies for the app - getRetentionPolicyRuns: query retention cleanup run history Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
Size Change: +940 B (+0.26%) Total Size: 366 kB 📦 View Changed
|
Tests cover filter_conditions (policy, date range), sort, cursor-based pagination (next/prev), combined options, empty response, and server-side auth validation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The mq parser only allows one operator per field expression. Date range filters need $and to combine $gte and $lte on the same field. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
oliverlaz
approved these changes
Mar 31, 2026
github-actions bot
pushed a commit
that referenced
this pull request
Mar 31, 2026
## [9.39.0](v9.38.0...v9.39.0) (2026-03-31) ### Features * [CHA-2563] add retention policy endpoints ([#1713](#1713)) ([18da9ed](18da9ed))
|
🎉 This PR is included in version 9.39.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Ticket
Summary
Adds server-side SDK methods for the retention policy CRUD endpoints:
setRetentionPolicy(policy, maxAgeHours)— creates or updates a retention policy (old-messagesorinactive-channels) with a max age between 24–43800 hoursdeleteRetentionPolicy(policy)— removes a retention policygetRetentionPolicy()— lists all retention policies configured for the appgetRetentionPolicyRuns(options?)— queries retention cleanup run history with support forfilter_conditions,sort, and cursor-based paginationAll endpoints are server-side only and require initializing the client with a secret.
New types added:
RetentionPolicy,RetentionPolicyConfig,RetentionRunStats,RetentionRunResponse, and request/response types for each endpoint.Checklist
src/types.tssrc/client.ts🤖 Generated with Claude Code