File tree Expand file tree Collapse file tree
packages/client/src/clients/feed Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -543,7 +543,7 @@ class Feed {
543543
544544 const mergedOptions = {
545545 ...this . defaultOptions ,
546- ...options ,
546+ ...mergeDateRangeParams ( options ) ,
547547 exclude : mergeAndDedupeArrays (
548548 this . defaultOptions . exclude ,
549549 options . exclude ,
@@ -552,15 +552,14 @@ class Feed {
552552
553553 // trigger_data should be a JSON string for the API
554554 // this function will format the trigger data if it's an object
555- // https://docs.knock.app/reference#get-feed
555+ // https://docs.knock.app/api-reference/users/feeds/list_items
556556 const formattedTriggerData = getFormattedTriggerData ( mergedOptions ) ;
557557
558558 const formattedExclude = getFormattedExclude ( mergedOptions ) ;
559559
560560 // Always include the default params, if they have been set
561561 const queryParams : FetchFeedOptionsForRequest = {
562- ...this . defaultOptions ,
563- ...mergeDateRangeParams ( options ) ,
562+ ...mergedOptions ,
564563 trigger_data : formattedTriggerData ,
565564 exclude : formattedExclude ,
566565 // Unset options that should not be sent to the API
Original file line number Diff line number Diff line change @@ -68,8 +68,11 @@ export type FetchFeedOptions = {
6868 __fetchSource ?: "socket" | "http" ;
6969} & Omit < FeedClientOptions , "__experimentalCrossBrowserUpdates" > ;
7070
71- // The final data shape that is sent to the API
72- // Should match types here: https://docs.knock.app/reference#get-feed
71+ /**
72+ * The final data shape that is sent to the the list feed items endpoint of the Knock API.
73+ *
74+ * @see https://docs.knock.app/api-reference/users/feeds/list_items
75+ */
7376export type FetchFeedOptionsForRequest = Omit <
7477 FeedClientOptions ,
7578 "trigger_data" | "exclude"
@@ -78,6 +81,10 @@ export type FetchFeedOptionsForRequest = Omit<
7881 trigger_data ?: string ;
7982 /** Fields to exclude from the response, joined by commas. */
8083 exclude ?: string ;
84+ "inserted_at.gte" ?: string ;
85+ "inserted_at.lte" ?: string ;
86+ "inserted_at.gt" ?: string ;
87+ "inserted_at.lt" ?: string ;
8188 // Unset options that should not be sent to the API
8289 __loadingType : undefined ;
8390 __fetchSource : undefined ;
You can’t perform that action at this time.
0 commit comments