Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions src/gen/feeds/FeedsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
AddActivityResponse,
AddBookmarkRequest,
AddBookmarkResponse,
AddCommentBookmarkRequest,
AddCommentBookmarkResponse,
AddCommentReactionRequest,
AddCommentReactionResponse,
AddCommentRequest,
Expand All @@ -36,6 +38,7 @@ import {
DeleteBookmarkFolderResponse,
DeleteBookmarkResponse,
DeleteCollectionsResponse,
DeleteCommentBookmarkResponse,
DeleteCommentReactionResponse,
DeleteCommentResponse,
DeleteFeedGroupResponse,
Expand Down Expand Up @@ -129,6 +132,8 @@ import {
UpdateBookmarkResponse,
UpdateCollectionsRequest,
UpdateCollectionsResponse,
UpdateCommentBookmarkRequest,
UpdateCommentBookmarkResponse,
UpdateCommentPartialRequest,
UpdateCommentPartialResponse,
UpdateCommentRequest,
Expand Down Expand Up @@ -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<StreamResponse<DeleteCommentBookmarkResponse>> {
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<DeleteCommentBookmarkResponse>
>(
'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<StreamResponse<UpdateCommentBookmarkResponse>> {
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<UpdateCommentBookmarkResponse>
>(
'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<StreamResponse<AddCommentBookmarkResponse>> {
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<AddCommentBookmarkResponse>
>(
'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;
Expand Down
23 changes: 23 additions & 0 deletions src/gen/model-decoders/decoders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,13 @@ decoders.AddBookmarkResponse = (input?: Record<string, any>) => {
return decode(typeMappings, input);
};

decoders.AddCommentBookmarkResponse = (input?: Record<string, any>) => {
const typeMappings: TypeMapping = {
bookmark: { type: 'BookmarkResponse', isSingle: true },
};
return decode(typeMappings, input);
};

decoders.AddCommentReactionResponse = (input?: Record<string, any>) => {
const typeMappings: TypeMapping = {
comment: { type: 'CommentResponse', isSingle: true },
Expand Down Expand Up @@ -612,6 +619,8 @@ decoders.BookmarkResponse = (input?: Record<string, any>) => {

user: { type: 'UserResponse', isSingle: true },

comment: { type: 'CommentResponse', isSingle: true },

folder: { type: 'BookmarkFolderResponse', isSingle: true },
};
return decode(typeMappings, input);
Expand Down Expand Up @@ -1925,6 +1934,13 @@ decoders.DeleteChannelResponse = (input?: Record<string, any>) => {
return decode(typeMappings, input);
};

decoders.DeleteCommentBookmarkResponse = (input?: Record<string, any>) => {
const typeMappings: TypeMapping = {
bookmark: { type: 'BookmarkResponse', isSingle: true },
};
return decode(typeMappings, input);
};

decoders.DeleteCommentReactionResponse = (input?: Record<string, any>) => {
const typeMappings: TypeMapping = {
comment: { type: 'CommentResponse', isSingle: true },
Expand Down Expand Up @@ -4895,6 +4911,13 @@ decoders.UpdateCommandResponse = (input?: Record<string, any>) => {
return decode(typeMappings, input);
};

decoders.UpdateCommentBookmarkResponse = (input?: Record<string, any>) => {
const typeMappings: TypeMapping = {
bookmark: { type: 'BookmarkResponse', isSingle: true },
};
return decode(typeMappings, input);
};

decoders.UpdateCommentPartialResponse = (input?: Record<string, any>) => {
const typeMappings: TypeMapping = {
comment: { type: 'CommentResponse', isSingle: true },
Expand Down
84 changes: 83 additions & 1 deletion src/gen/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>;

new_folder?: AddFolderRequest;

user?: UserRequest;
}

export interface AddCommentBookmarkResponse {
duration: string;

bookmark: BookmarkResponse;
}

export interface AddCommentReactionRequest {
/**
* The type of reaction, eg upvote, like, ...
Expand Down Expand Up @@ -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
*/
Expand All @@ -2593,6 +2627,10 @@ export interface BookmarkResponse {

user: UserResponse;

activity_id?: string;

comment?: CommentResponse;

/**
* Custom data for the bookmark
*/
Expand Down Expand Up @@ -6178,6 +6216,8 @@ export interface CommentReactionUpdatedEvent {
}

export interface CommentResponse {
bookmark_count: number;

/**
* Confidence score of the comment
*/
Expand Down Expand Up @@ -7725,6 +7765,12 @@ export interface DeleteCommandResponse {
name: string;
}

export interface DeleteCommentBookmarkResponse {
duration: string;

bookmark: BookmarkResponse;
}

export interface DeleteCommentReactionResponse {
duration: string;

Expand Down Expand Up @@ -11455,6 +11501,8 @@ export interface ImportV2TaskSettings {

skip_references_check?: boolean;

source?: string;

s3?: ImportV2TaskSettingsS3;
}

Expand Down Expand Up @@ -20484,6 +20532,8 @@ export interface ThreadUpdatedEvent {
}

export interface ThreadedCommentResponse {
bookmark_count: number;

confidence_score: number;

created_at: Date;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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<string, any>;

new_folder?: AddFolderRequest;

user?: UserRequest;
}

export interface UpdateCommentBookmarkResponse {
duration: string;

bookmark: BookmarkResponse;
}

export interface UpdateCommentPartialRequest {
/**
* @deprecated
Expand Down
Loading