Skip to content

Comments

chore(KNO-11661): improve FetchFeedOptionsForRequest type#858

Merged
mattmikolay merged 5 commits intomainfrom
mattmik-kno-11661-client-sdk-improve-fetchfeedoptionsforrequest-type
Feb 13, 2026
Merged

chore(KNO-11661): improve FetchFeedOptionsForRequest type#858
mattmikolay merged 5 commits intomainfrom
mattmik-kno-11661-client-sdk-improve-fetchfeedoptionsforrequest-type

Conversation

@mattmikolay
Copy link
Contributor

Description

This PR updates the FetchFeedOptionsForRequest type to improve some comments and add the following missing fields:

  • inserted_at.gte
  • inserted_at.gt
  • inserted_at.lte
  • inserted_at.lt

FetchFeedOptionsForRequest is meant to represent the params included in the API request. Notice that the mergeDateRangeParams function transforms the inserted_at_date_range option on FeedClientOptions into the appropriate date params, e.g. inserted_at.gte, inserted_at.lte, etc.

export function mergeDateRangeParams(options: FeedClientOptions) {
const { inserted_at_date_range, ...rest } = options;
if (!inserted_at_date_range) {
return rest;
}
const dateRangeParams: Record<string, string> = {};
// Determine which operators to use based on the inclusive flag
const isInclusive = inserted_at_date_range.inclusive ?? false;
// For start date: use gte if inclusive, gt if not
if (inserted_at_date_range.start) {
const startOperator = isInclusive ? "inserted_at.gte" : "inserted_at.gt";
dateRangeParams[startOperator] = inserted_at_date_range.start;
}
// For end date: use lte if inclusive, lt if not
if (inserted_at_date_range.end) {
const endOperator = isInclusive ? "inserted_at.lte" : "inserted_at.lt";
dateRangeParams[endOperator] = inserted_at_date_range.end;
}
return { ...rest, ...dateRangeParams };
}

I made a similar change as part of #853, but it was reverted by #857.

Checklist

  • Tests have been added for new features or major refactors to existing features.

@linear
Copy link

linear bot commented Feb 12, 2026

@vercel
Copy link

vercel bot commented Feb 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
javascript-ms-teams-connect-example Ready Ready Preview, Comment Feb 13, 2026 2:37pm
javascript-nextjs-example Ready Ready Preview, Comment Feb 13, 2026 2:37pm
javascript-slack-connect-example Ready Ready Preview, Comment Feb 13, 2026 2:37pm
javascript-slack-kit-example Ready Ready Preview, Comment Feb 13, 2026 2:37pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 12, 2026

🦋 Changeset detected

Latest commit: 4b53803

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@knocklabs/client Patch
client-example Patch
guide-example Patch
@knocklabs/expo Patch
@knocklabs/react-core Patch
@knocklabs/react-native Patch
@knocklabs/react Patch
@knocklabs/expo-example Patch
ms-teams-connect-example Patch
nextjs-app-dir-example Patch
nextjs-example Patch
slack-connect-example Patch
slack-kit-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@mattmikolay mattmikolay merged commit ddd7981 into main Feb 13, 2026
12 checks passed
@mattmikolay mattmikolay deleted the mattmik-kno-11661-client-sdk-improve-fetchfeedoptionsforrequest-type branch February 13, 2026 18:21
@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.34%. Comparing base (902aabb) to head (4b53803).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #858   +/-   ##
=======================================
  Coverage   67.34%   67.34%           
=======================================
  Files         203      203           
  Lines        8461     8461           
  Branches     1101     1101           
=======================================
  Hits         5698     5698           
  Misses       2738     2738           
  Partials       25       25           
Files with missing lines Coverage Δ
packages/client/src/clients/feed/utils.ts 100.00% <100.00%> (ø)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants