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 @@ -70,8 +70,11 @@ export type FetchFeedOptions = {
7070 __fetchSource ?: "socket" | "http" ;
7171} & Omit < FeedClientOptions , "__experimentalCrossBrowserUpdates" > ;
7272
73- // The final data shape that is sent to the API
74- // Should match types here: https://docs.knock.app/reference#get-feed
73+ /**
74+ * The final data shape that is sent to the the list feed items endpoint of the Knock API.
75+ *
76+ * @see https://docs.knock.app/api-reference/users/feeds/list_items
77+ */
7578export type FetchFeedOptionsForRequest = Omit <
7679 FeedClientOptions ,
7780 "trigger_data" | "exclude"
@@ -80,6 +83,10 @@ export type FetchFeedOptionsForRequest = Omit<
8083 trigger_data ?: string ;
8184 /** Fields to exclude from the response, joined by commas. */
8285 exclude ?: string ;
86+ "inserted_at.gte" ?: string ;
87+ "inserted_at.lte" ?: string ;
88+ "inserted_at.gt" ?: string ;
89+ "inserted_at.lt" ?: string ;
8390 // Unset options that should not be sent to the API
8491 __loadingType : undefined ;
8592 __fetchSource : undefined ;
You can’t perform that action at this time.
0 commit comments