diff --git a/src/gen/feeds/FeedsApi.ts b/src/gen/feeds/FeedsApi.ts index ccc66ec..0eb73a9 100644 --- a/src/gen/feeds/FeedsApi.ts +++ b/src/gen/feeds/FeedsApi.ts @@ -10,6 +10,8 @@ import { AddActivityResponse, AddBookmarkRequest, AddBookmarkResponse, + AddCommentBookmarkRequest, + AddCommentBookmarkResponse, AddCommentReactionRequest, AddCommentReactionResponse, AddCommentRequest, @@ -36,6 +38,7 @@ import { DeleteBookmarkFolderResponse, DeleteBookmarkResponse, DeleteCollectionsResponse, + DeleteCommentBookmarkResponse, DeleteCommentReactionResponse, DeleteCommentResponse, DeleteFeedGroupResponse, @@ -129,6 +132,8 @@ import { UpdateBookmarkResponse, UpdateCollectionsRequest, UpdateCollectionsResponse, + UpdateCommentBookmarkRequest, + UpdateCommentBookmarkResponse, UpdateCommentPartialRequest, UpdateCommentPartialResponse, UpdateCommentRequest, @@ -1118,6 +1123,94 @@ export class FeedsApi { return { ...response.body, metadata: response.metadata }; } + async deleteCommentBookmark(request: { + comment_id: string; + folder_id?: string; + user_id?: string; + }): Promise> { + const queryParams = { + folder_id: request?.folder_id, + user_id: request?.user_id, + }; + const pathParams = { + comment_id: request?.comment_id, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >( + 'DELETE', + '/api/v2/feeds/comments/{comment_id}/bookmarks', + pathParams, + queryParams, + ); + + decoders.DeleteCommentBookmarkResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + + async updateCommentBookmark( + request: UpdateCommentBookmarkRequest & { comment_id: string }, + ): Promise> { + const pathParams = { + comment_id: request?.comment_id, + }; + const body = { + folder_id: request?.folder_id, + new_folder_id: request?.new_folder_id, + user_id: request?.user_id, + custom: request?.custom, + new_folder: request?.new_folder, + user: request?.user, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >( + 'PATCH', + '/api/v2/feeds/comments/{comment_id}/bookmarks', + pathParams, + undefined, + body, + 'application/json', + ); + + decoders.UpdateCommentBookmarkResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + + async addCommentBookmark( + request: AddCommentBookmarkRequest & { comment_id: string }, + ): Promise> { + const pathParams = { + comment_id: request?.comment_id, + }; + const body = { + folder_id: request?.folder_id, + user_id: request?.user_id, + custom: request?.custom, + new_folder: request?.new_folder, + user: request?.user, + }; + + const response = await this.apiClient.sendRequest< + StreamResponse + >( + 'POST', + '/api/v2/feeds/comments/{comment_id}/bookmarks', + pathParams, + undefined, + body, + 'application/json', + ); + + decoders.AddCommentBookmarkResponse?.(response.body); + + return { ...response.body, metadata: response.metadata }; + } + async deleteComment(request: { id: string; hard_delete?: boolean; diff --git a/src/gen/model-decoders/decoders.ts b/src/gen/model-decoders/decoders.ts index b0c26f0..19a7de5 100644 --- a/src/gen/model-decoders/decoders.ts +++ b/src/gen/model-decoders/decoders.ts @@ -292,6 +292,13 @@ decoders.AddBookmarkResponse = (input?: Record) => { return decode(typeMappings, input); }; +decoders.AddCommentBookmarkResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + bookmark: { type: 'BookmarkResponse', isSingle: true }, + }; + return decode(typeMappings, input); +}; + decoders.AddCommentReactionResponse = (input?: Record) => { const typeMappings: TypeMapping = { comment: { type: 'CommentResponse', isSingle: true }, @@ -612,6 +619,8 @@ decoders.BookmarkResponse = (input?: Record) => { user: { type: 'UserResponse', isSingle: true }, + comment: { type: 'CommentResponse', isSingle: true }, + folder: { type: 'BookmarkFolderResponse', isSingle: true }, }; return decode(typeMappings, input); @@ -1925,6 +1934,13 @@ decoders.DeleteChannelResponse = (input?: Record) => { return decode(typeMappings, input); }; +decoders.DeleteCommentBookmarkResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + bookmark: { type: 'BookmarkResponse', isSingle: true }, + }; + return decode(typeMappings, input); +}; + decoders.DeleteCommentReactionResponse = (input?: Record) => { const typeMappings: TypeMapping = { comment: { type: 'CommentResponse', isSingle: true }, @@ -4895,6 +4911,13 @@ decoders.UpdateCommandResponse = (input?: Record) => { return decode(typeMappings, input); }; +decoders.UpdateCommentBookmarkResponse = (input?: Record) => { + const typeMappings: TypeMapping = { + bookmark: { type: 'BookmarkResponse', isSingle: true }, + }; + return decode(typeMappings, input); +}; + decoders.UpdateCommentPartialResponse = (input?: Record) => { const typeMappings: TypeMapping = { comment: { type: 'CommentResponse', isSingle: true }, diff --git a/src/gen/models/index.ts b/src/gen/models/index.ts index 11863f6..9945b85 100644 --- a/src/gen/models/index.ts +++ b/src/gen/models/index.ts @@ -1301,6 +1301,30 @@ export interface AddBookmarkResponse { bookmark: BookmarkResponse; } +export interface AddCommentBookmarkRequest { + /** + * ID of the folder to add the bookmark to + */ + folder_id?: string; + + user_id?: string; + + /** + * Custom data for the bookmark + */ + custom?: Record; + + new_folder?: AddFolderRequest; + + user?: UserRequest; +} + +export interface AddCommentBookmarkResponse { + duration: string; + + bookmark: BookmarkResponse; +} + export interface AddCommentReactionRequest { /** * The type of reaction, eg upvote, like, ... @@ -2584,6 +2608,16 @@ export interface BookmarkResponse { */ created_at: Date; + /** + * ID of the bookmarked object + */ + object_id: string; + + /** + * Type of the bookmarked object (activity or comment) + */ + object_type: string; + /** * When the bookmark was last updated */ @@ -2593,6 +2627,10 @@ export interface BookmarkResponse { user: UserResponse; + activity_id?: string; + + comment?: CommentResponse; + /** * Custom data for the bookmark */ @@ -6178,6 +6216,8 @@ export interface CommentReactionUpdatedEvent { } export interface CommentResponse { + bookmark_count: number; + /** * Confidence score of the comment */ @@ -7725,6 +7765,12 @@ export interface DeleteCommandResponse { name: string; } +export interface DeleteCommentBookmarkResponse { + duration: string; + + bookmark: BookmarkResponse; +} + export interface DeleteCommentReactionResponse { duration: string; @@ -11455,6 +11501,8 @@ export interface ImportV2TaskSettings { skip_references_check?: boolean; + source?: string; + s3?: ImportV2TaskSettingsS3; } @@ -20484,6 +20532,8 @@ export interface ThreadUpdatedEvent { } export interface ThreadedCommentResponse { + bookmark_count: number; + confidence_score: number; created_at: Date; @@ -21545,10 +21595,13 @@ export interface UpdateBookmarkFolderResponse { export interface UpdateBookmarkRequest { /** - * ID of the folder to move the bookmark to + * ID of the folder containing the bookmark */ folder_id?: string; + /** + * Move the bookmark to this folder (empty string removes the folder) + */ new_folder_id?: string; user_id?: string; @@ -21992,6 +22045,35 @@ export interface UpdateCommandResponse { command?: Command; } +export interface UpdateCommentBookmarkRequest { + /** + * ID of the folder containing the bookmark + */ + folder_id?: string; + + /** + * Move the bookmark to this folder (empty string removes the folder) + */ + new_folder_id?: string; + + user_id?: string; + + /** + * Custom data for the bookmark + */ + custom?: Record; + + new_folder?: AddFolderRequest; + + user?: UserRequest; +} + +export interface UpdateCommentBookmarkResponse { + duration: string; + + bookmark: BookmarkResponse; +} + export interface UpdateCommentPartialRequest { /** * @deprecated