Skip to content

feat: [CHA-2563] add retention policy endpoints#1713

Merged
hifaizsk merged 3 commits intomasterfrom
feature/cha-2563-retention-policy-endpoints
Mar 31, 2026
Merged

feat: [CHA-2563] add retention policy endpoints#1713
hifaizsk merged 3 commits intomasterfrom
feature/cha-2563-retention-policy-endpoints

Conversation

@hifaizsk
Copy link
Copy Markdown
Contributor

Ticket

Summary

Adds server-side SDK methods for the retention policy CRUD endpoints:

  • setRetentionPolicy(policy, maxAgeHours) — creates or updates a retention policy (old-messages or inactive-channels) with a max age between 24–43800 hours
  • deleteRetentionPolicy(policy) — removes a retention policy
  • getRetentionPolicy() — lists all retention policies configured for the app
  • getRetentionPolicyRuns(options?) — queries retention cleanup run history with support for filter_conditions, sort, and cursor-based pagination

All 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

  • Types added to src/types.ts
  • Methods added to src/client.ts
  • TypeScript compilation passes
  • Prettier formatting passes
  • The changed code has been covered with unit tests
  • API endpoints are covered with client tests

🤖 Generated with Claude Code

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>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

Size Change: +940 B (+0.26%)

Total Size: 366 kB

📦 View Changed
Filename Size Change
dist/cjs/index.browser.js 122 kB +311 B (+0.26%)
dist/cjs/index.node.js 123 kB +312 B (+0.25%)
dist/esm/index.mjs 121 kB +317 B (+0.26%)

compressed-size-action

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>
@hifaizsk hifaizsk changed the title [CHA-2563] Add retention policy endpoints feat: [CHA-2563] add retention policy endpoints Mar 31, 2026
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>
@hifaizsk hifaizsk merged commit 18da9ed into master Mar 31, 2026
4 checks passed
@hifaizsk hifaizsk deleted the feature/cha-2563-retention-policy-endpoints branch March 31, 2026 13:53
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))
@stream-ci-bot
Copy link
Copy Markdown

🎉 This PR is included in version 9.39.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants